forked from lavishsheth/code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get Started with Looker: Challenge Lab
48 lines (34 loc) · 1.11 KB
/
Get Started with Looker: Challenge Lab
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
PART 1:
view: users_region {
derived_table: {
sql: SELECT
id,
state,
country
FROM
`cloud-training-demos.looker_ecomm.users` ;;
}
dimension: id {
type: number
primary_key: yes
sql: ${TABLE}.id ;;
}
dimension: state {
type: string
sql: ${TABLE}.state ;;
}
dimension: country {
type: string
sql: ${TABLE}.country ;;
}
measure: count {
type: count
drill_fields: [id, state, country]
}
}
PART 2 :
join: users_region {
type: left_outer
sql_on: ${events.user_id} = ${users_region.id};;
relationship: many_to_one
}