-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.view.lkml
97 lines (81 loc) · 1.51 KB
/
test.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
#view: test {
# derived_table: {
# sql:
# SELECT * FROM (SELECT 'foo' as some_string, 1 as some_num
# UNION ALL
# SELECT 'bar' as some_string, 2 as some_num
# UNION ALL
# SELECT 'bar' as some_string, 3 as some_num
# UNION ALL
# SELECT NULL as some_string, 4 as some_num)
# ;;
# }
#
# measure: test_measure {
# type: number
# sql: {{ test_param }} ;;
# }
#
# parameter: test_param {
# type: unquoted
# allowed_value: {
# label: "count"
# value: "${count}"
# }
# }
#
# dimension: some_string {
# type: string
# }
#
# dimension: some_num {
# type: number
# }
#
# measure: count {
# type: count
# }
#}
view: test {
derived_table: {
sql:
SELECT 'foo' as some_string, 1 as some_num
UNION ALL
SELECT 'bar' as some_string, 2 as some_num
UNION ALL
SELECT 'bar' as some_string, 3 as some_num
UNION ALL
SELECT 'yes' as some_string, {{ "2015" | convert: "number" }} as some_num;;
}
dimension: some_string {
type: string
}
parameter: test_param {
allowed_value: {
label: "USD"
value: "usd"
}
allowed_value: {
label: "GDP"
value: "gdp"
}
}
dimension: some_num {
type: number
}
measure: count {
type: count
}
filter: string_filter {
type: string
}
filter: number_filter {
type: number
}
filter: number_filter_2 {
type: number
}
parameter: number_parameter {
type: number
}
}