-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecommerce_users_baolq.model.aml
86 lines (85 loc) · 1.94 KB
/
ecommerce_users_baolq.model.aml
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
Model ecommerce_users_baolq {
type: 'table'
label: 'Users'
description: ''
data_source_name: 'demo_db'
dimension id {
label: 'Id'
type: 'number'
hidden: false
definition: @sql {{ #SOURCE.id }};;
}
dimension sign_up_date {
label: 'Sign Up Date'
type: 'date'
hidden: false
definition: @sql {{ #SOURCE.sign_up_date }};;
}
dimension sign_up_at {
label: 'Sign Up At'
type: 'datetime'
hidden: false
definition: @sql {{ #SOURCE.sign_up_at }};;
}
dimension first_name {
label: 'First Name'
type: 'text'
hidden: false
definition: @sql {{ #SOURCE.first_name }};;
}
dimension last_name {
label: 'Last Name'
type: 'text'
hidden: false
definition: @sql {{ #SOURCE.last_name }};;
}
dimension email {
label: 'Email'
type: 'text'
hidden: false
definition: @sql {{ #SOURCE.email }};;
}
dimension birth_date {
label: 'Birth Date'
type: 'date'
hidden: false
definition: @sql {{ #SOURCE.birth_date }};;
}
dimension gender {
label: 'Gender'
type: 'text'
hidden: false
definition: @sql {{ #SOURCE.gender }};;
}
dimension city_id {
label: 'City Id'
type: 'number'
hidden: false
definition: @sql {{ #SOURCE.city_id }};;
}
dimension full_name {
label: 'Full Name'
type: 'text'
hidden: false
definition: @sql {{ #SOURCE.full_name }};;
}
dimension age_group {
label: "Age Group"
type: "text"
definition: @sql case
when {{ age }} < 20 then '1. Under 20'
when {{ age }} >= 20 and {{ age }} < 30 then '2. From 20 to 29'
when {{ age }} >= 30 and {{ age }} < 40 then '3. From 30 to 39'
when {{ age }} >= 40 then '4. 40 and up'
end;;
}
owner: 'bao.lq@holistics.io'
table_name: '"ecommerce"."users"'
measure all_orders_count {
label: "All Orders Count"
type: "number"
definition: @sql count({{id}});;
description: "Total Orders"
aggregation_type: "count"
}
}