-
Notifications
You must be signed in to change notification settings - Fork 45
/
redshift.zcta_distances.view.lkml
43 lines (39 loc) · 1.12 KB
/
redshift.zcta_distances.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
view: rs_zcta_distances {
derived_table: {
sql: SELECT *
FROM
acs.zcta_distances
WHERE
LPAD(CAST(zip1 AS VARCHAR),5, '0') = LPAD(CAST({% parameter zcta_distances.zip1 %} AS VARCHAR), 5, '0')
UNION ALL
SELECT
LPAD(CAST({% parameter zcta_distances.zip1 %} AS VARCHAR), 5, '0') as zip1,
LPAD(CAST({% parameter zcta_distances.zip1 %} AS VARCHAR), 5, '0') as zip2,
0
;;
}
dimension: mi_to_zcta5 {
label: "Miles from selected ZIP"
view_label: "Geography"
group_label: "ZIP Radii"
type: number
sql: ${TABLE}.mi_to_zcta5 ;;
value_format_name: decimal_2
}
dimension: zip1 {
label: "Selected ZIP Code"
view_label: "Geography"
group_label: "ZIP Radii"
type: zipcode
sql: LPAD(CAST(${TABLE}.zip1 AS VARCHAR), 5, '0') ;;
suggestable: no
}
dimension: zip2 {
label: "Nearby ZIP"
view_label: "Geography"
group_label: "ZIP Radii"
type: zipcode
sql: LPAD(CAST(${TABLE}.zip2 AS VARCHAR), 5, '0') ;;
hidden: yes
}
}