-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathfirebase.model.lkml
51 lines (42 loc) · 1.55 KB
/
firebase.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
connection: "firebase-sample"
include: "*.view.lkml" # include all views in this project
# include: "my_dashboard.dashboard.lookml" # include a LookML dashboard called my_dashboard
datagroup: daily {
sql_trigger: SELECT CURRENT_DATE() ;;
max_cache_age: "24 hours"
}
explore: events {
## TO avoid querying the entire database by default, suggest setting up a filter like below, and perhaps limiting GB scanned with 'Max Billing Gigabytes' in the connection
always_filter: {
filters: {
field: event_date
value: "last 7 days"
}
}
join: events__event_params {
view_label: "Event Properties"
sql: LEFT JOIN UNNEST(events.event_params) as events__event_params ;;
relationship: one_to_many
}
join: events__event_params__value {
view_label: "Event Properties"
sql: LEFT JOIN UNNEST([events__event_params.value]) as events__event_params__value ;;
relationship: one_to_many
}
join: events__user_properties {
sql: LEFT JOIN UNNEST(events.user_properties) as events__user_properties ;;
view_label: "User Properties"
relationship: one_to_many
}
join: events__user_properties__value {
view_label: "User Properties"
sql: LEFT JOIN UNNEST([events__user_properties.value]) as events__user_properties__value ;;
relationship: one_to_many
}
join: sessions {
sql_on: ${events.user_pseudo_id} = ${sessions.user_pseudo_id}
AND ${events._event_raw} >= ${sessions.session_start_raw}
AND ${events._event_raw} <= ${sessions.session_end_raw} ;;
relationship: many_to_one
}
}