-
Notifications
You must be signed in to change notification settings - Fork 42
/
tracks.model.lkml
92 lines (78 loc) · 2.14 KB
/
tracks.model.lkml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
connection: "segment_sources"
# include all views in this project
include: "*.view"
# include all dashboards in this project
include: "*.dashboard"
explore: track_facts {
view_label: "Events"
label: "Events"
join: tracks {
view_label: "Events"
type: left_outer
relationship: one_to_one
sql_on: tracks.uuid = track_facts.uuid and
tracks.received_at = track_facts.received_at and
tracks.anonymous_id = track_facts.anonymous_id
;;
}
join: sessions_trk {
view_label: "Sessions"
type: left_outer
sql_on: ${track_facts.session_id} = ${sessions_trk.session_id} ;;
relationship: many_to_one
}
join: session_trk_facts {
view_label: "Sessions"
type: left_outer
sql_on: ${track_facts.session_id} = ${session_trk_facts.session_id} ;;
relationship: many_to_one
}
join: user_session_facts {
view_label: "Users"
type: left_outer
sql_on: ${track_facts.looker_visitor_id} = ${user_session_facts.looker_visitor_id} ;;
relationship: many_to_one
}
join: users {
view_label: "Users"
type: left_outer
sql_on: ${user_session_facts.looker_visitor_id} = ${users.id} ;;
relationship: one_to_one
}
join: tracks_flow {
view_label: "Events Flow"
sql_on: ${track_facts.event_id} = ${tracks_flow.event_id} ;;
relationship: one_to_one
}
}
explore: sessions_trk {
join: session_trk_facts {
view_label: "sessions"
sql_on: ${sessions_trk.session_id} = ${session_trk_facts.session_id} ;;
relationship: one_to_one
}
join: user_session_facts {
view_label: "Users"
sql_on: ${sessions_trk.looker_visitor_id} = ${user_session_facts.looker_visitor_id} ;;
relationship: many_to_one
}
}
explore: funnel_explorer {
join: sessions_trk {
view_label: "sessions"
foreign_key: session_id
}
join: user_session_facts {
view_label: "Users"
foreign_key: sessions_trk.looker_visitor_id
}
join: session_trk_facts {
view_label: "sessions"
relationship: one_to_one
foreign_key: session_id
}
join: users {
relationship: many_to_one
sql_on: coalesce(users.mapped_user_id, users.user_id) = sessions.user_id ;;
}
}