forked from llooker/datablocks-acs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bigquery.zcta_distances.view.lkml
45 lines (40 loc) · 1.05 KB
/
bigquery.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
44
45
view: bq_zcta_distances {
derived_table: {
sql: SELECT *
FROM
`looker-datablocks.acs_fast_facts.zcta_distances_*`
WHERE
zip1 = {% parameter zcta_distances.zip1 %}
AND _TABLE_SUFFIX = SUBSTR( {% parameter zcta_distances.zip1 %}, 0, 1)
UNION ALL
SELECT
{% parameter zcta_distances.zip1 %} as zip1,
{% parameter zcta_distances.zip1 %} 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: ${TABLE}.zip1 ;;
suggestable: no
}
dimension: zip2 {
label: "Nearby ZIP"
view_label: "Geography"
group_label: "ZIP Radii"
type: zipcode
sql: ${TABLE}.zip2 ;;
hidden: yes
}
}