-
Notifications
You must be signed in to change notification settings - Fork 0
/
smartthings_readings.view.lkml
129 lines (113 loc) · 2 KB
/
smartthings_readings.view.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
view: smartthings_readings {
view_label: "6. Smart Devices"
sql_table_name: personal_metrics.smartthings_readings ;;
dimension: pk {
type: string
primary_key: yes
hidden: yes
sql: concat(cast(${TABLE}.date_time as string),${TABLE}.device) ;;
}
dimension_group: date {
type: time
hidden: yes
timeframes: [
raw,
time,
hour,
hour3,
hour4,
hour6,
hour12,
hour_of_day,
time_of_day,
minute,
minute5,
minute10,
minute15,
minute30,
day_of_week,
day_of_month,
day_of_year,
date,
week,
week_of_year,
month,
month_name,
month_num,
quarter,
year
]
sql: ${TABLE}.date_time ;;
}
dimension_group: start_date {
type: time
timeframes: [
raw,
time,
hour,
hour3,
hour4,
hour6,
hour12,
hour_of_day,
time_of_day,
minute,
minute5,
minute10,
minute15,
minute30,
day_of_week,
day_of_month,
day_of_year,
date,
week,
week_of_year,
month,
month_name,
month_num,
quarter,
year
]
sql: ${TABLE}.date_time ;;
}
dimension: device {
group_label: "Smart Device"
type: string
sql: ${TABLE}.device ;;
}
dimension: device_type {
group_label: "Smart Device"
type: string
sql: ${TABLE}.device_type ;;
}
dimension: metric {
group_label: "Smart Device"
type: string
sql: ${TABLE}.metric ;;
}
dimension: raw_value {
type: string
sql: ${TABLE}.raw_value ;;
}
dimension: room {
group_label: "Smart Device"
type: string
sql: ${TABLE}.room ;;
}
measure: avg_sensor_value {
type: average
sql: ${TABLE}.value ;;
}
measure:max_sensor_value {
type: max
sql: ${TABLE}.value ;;
}
measure:min_sensor_value {
type: min
sql: ${TABLE}.value ;;
}
measure: count {
type: count
drill_fields: []
}
}