-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
rei tamai
committed
Oct 12, 2020
1 parent
c4dd4bf
commit 8780e12
Showing
10 changed files
with
322 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
connection: "cm_snowflake" | ||
|
||
include: "/views/*.view" | ||
|
||
datagroup: cm_tamai_naracrime_default_datagroup { | ||
max_cache_age: "1 hour" | ||
} | ||
|
||
persist_with: cm_tamai_naracrime_default_datagroup | ||
|
||
explore: basic_info { | ||
label: "奈良県犯罪情報(基本)" | ||
} | ||
|
||
explore: hit_bicycle { | ||
label: "自転車盗" | ||
} | ||
|
||
explore: hit_car { | ||
label: "自動車盗" | ||
} | ||
|
||
explore: hit_bike { | ||
label: "オートバイ盗" | ||
} | ||
|
||
explore: aim_automat { | ||
label: "自動販売機ねらい" | ||
} | ||
|
||
explore: aim_parts { | ||
label: "部品ねらい" | ||
} | ||
|
||
explore: car_break_in { | ||
label: "車上ねらい" | ||
} | ||
|
||
explore: grab { | ||
label: "ひったくり" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
include: "/views/extend_base.view" | ||
|
||
view: aim_automat { | ||
extends: [extend_base] | ||
sql_table_name: "NARA_CRIME"."aim_automat" ;; | ||
|
||
dimension: damage_cash { | ||
label: "現金被害の有無" | ||
type: yesno | ||
sql: ${TABLE}."damage_cash" = 'あり' ;; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
include: "/views/extend_base.view" | ||
|
||
view: aim_parts { | ||
extends: [extend_base] | ||
sql_table_name: "NARA_CRIME"."aim_parts" ;; | ||
|
||
dimension: damage { | ||
label: "現金以外の主な被害品" | ||
type: string | ||
sql: ${TABLE}."damage" ;; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
include: "/views/extend_base.view" | ||
|
||
view: basic_info { | ||
extends: [extend_base] | ||
|
||
derived_table: { | ||
sql: SELECT "RecordID","deception","precinct","police_booth","municipality","town","datetime_occurrence","attribute_occurrence","Latitude","Longitude" | ||
FROM "NARA_CRIME"."aim_parts" | ||
UNION | ||
SELECT "RecordID","deception","precinct","police_booth","municipality","town","datetime_occurrence","attribute_occurrence","Latitude","Longitude" | ||
FROM "NARA_CRIME"."grab" | ||
union | ||
SELECT "RecordID","deception","precinct","police_booth","municipality","town","datetime_occurrence","attribute_occurrence","Latitude","Longitude" | ||
FROM "NARA_CRIME"."aim_automat" | ||
union | ||
SELECT "RecordID","deception","precinct","police_booth","municipality","town","datetime_occurrence","attribute_occurrence","Latitude","Longitude" | ||
FROM "NARA_CRIME"."hit_bike" | ||
union | ||
SELECT "RecordID","deception","precinct","police_booth","municipality","town","datetime_occurrence","attribute_occurrence","Latitude","Longitude" | ||
FROM "NARA_CRIME"."hit_bicycle" | ||
union | ||
SELECT "RecordID","deception","precinct","police_booth","municipality","town","datetime_occurrence","attribute_occurrence","Latitude","Longitude" | ||
FROM "NARA_CRIME"."hit_car" | ||
union | ||
SELECT "RecordID","deception","precinct","police_booth","municipality","town","datetime_occurrence","attribute_occurrence","Latitude","Longitude" | ||
FROM "NARA_CRIME"."car_break_in" | ||
;; | ||
} | ||
|
||
dimension: deception { | ||
label: "手口" | ||
type: string | ||
sql: ${TABLE}."deception" ;; | ||
link: { | ||
label: "詳細ダッシュボードへ" | ||
url: " | ||
{% if value == '自転車盗' %} | ||
/dashboards/79?市区町村= {{ basic_info.municipality._value }}&町丁目= {{ basic_info.town._value }} | ||
{% elsif value == 'ひったくり' %} | ||
/dashboards/73?市区町村= {{ basic_info.municipality._value }}&町丁目= {{ basic_info.town._value }} | ||
{% elsif value == 'オートバイ盗' %} | ||
/dashboards/78?市区町村= {{ basic_info.municipality._value }}&町丁目= {{ basic_info.town._value }} | ||
{% elsif value == '自動販売機ねらい' %} | ||
/dashboards/78?市区町村= {{ basic_info.municipality._value }}&町丁目= {{ basic_info.town._value }} | ||
{% elsif value == '車上ねらい' %} | ||
/dashboards/76?市区町村= {{ basic_info.municipality._value }}&町丁目= {{ basic_info.town._value }} | ||
{% elsif value == '自動車盗' %} | ||
/dashboards/77?市区町村= {{ basic_info.municipality._value }}&町丁目= {{ basic_info.town._value }} | ||
{% elsif value == '部品ねらい' %} | ||
/dashboards/75?市区町村= {{ basic_info.municipality._value }}&町丁目= {{ basic_info.town._value }} | ||
{% endif %} | ||
" | ||
} | ||
} | ||
|
||
# dimension: deception { | ||
# label: "手口" | ||
# type: string | ||
# sql: ${TABLE}."deception" ;; | ||
# link: { | ||
# label: "詳細ダッシュボードへ" | ||
# url: "/dashboards/79?発生場所={{ basic_info.location._value }}" | ||
# } | ||
# } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
include: "/views/extend_base.view" | ||
|
||
view: car_break_in { | ||
extends: [extend_base] | ||
sql_table_name: "NARA_CRIME"."car_break_in" ;; | ||
|
||
dimension: damage_cash { | ||
label: "現金被害の有無" | ||
type: yesno | ||
sql: ${TABLE}."damage_cash" = 'あり' ;; | ||
} | ||
|
||
dimension: lockup { | ||
label: "施錠関係" | ||
type: yesno | ||
sql: ${TABLE}."lockup" = '施錠した' ;; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
view: extend_base { | ||
extension: required | ||
|
||
dimension: record_id { | ||
primary_key: yes | ||
hidden: yes | ||
type: number | ||
sql: ${TABLE}."RecordID" ;; | ||
} | ||
|
||
dimension: deception { | ||
label: "手口" | ||
type: string | ||
sql: ${TABLE}."deception" ;; | ||
} | ||
|
||
dimension: precinct { | ||
label: "管轄警察署(発生地)" | ||
type: string | ||
sql: ${TABLE}."precinct" ;; | ||
} | ||
|
||
dimension: police_booth { | ||
label: "管轄交番・駐在所(発生地)" | ||
type: string | ||
sql: ${TABLE}."police_booth" ;; | ||
} | ||
|
||
dimension: municipality { | ||
label: "市区町村(発生地)" | ||
type: string | ||
sql: ${TABLE}."municipality" ;; | ||
} | ||
|
||
dimension: town { | ||
label: "町丁目(発生地)" | ||
type: string | ||
sql: ${TABLE}."town" ;; | ||
} | ||
|
||
dimension_group: datetime_occurrence { | ||
label: "発生年月日時(始期)" | ||
type: time | ||
sql: ${TABLE}."datetime_occurrence" ;; | ||
} | ||
|
||
dimension: attribute_occurrence { | ||
label: "発生場所の属性" | ||
type: string | ||
sql: ${TABLE}."attribute_occurrence" ;; | ||
} | ||
|
||
dimension: latitude { | ||
hidden: yes | ||
type: number | ||
sql: ${TABLE}."Latitude" ;; | ||
} | ||
|
||
dimension: longitude { | ||
hidden: yes | ||
type: number | ||
sql: ${TABLE}."Longitude" ;; | ||
} | ||
|
||
dimension: location { | ||
label: "発生場所" | ||
type: location | ||
sql_latitude: ${latitude} ;; | ||
sql_longitude: ${longitude} ;; | ||
} | ||
|
||
measure: count { | ||
label: "件数" | ||
type: count | ||
drill_fields: [detail*] | ||
} | ||
|
||
set: detail { | ||
fields: [ | ||
datetime_occurrence, | ||
deception, | ||
municipality, | ||
town, | ||
attribute_occurrence, | ||
location | ||
] | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
include: "/views/extend_base.view" | ||
|
||
view: grab { | ||
extends: [extend_base] | ||
sql_table_name: "NARA_CRIME"."grab" ;; | ||
|
||
dimension: damage_cash { | ||
label: "現金被害の有無" | ||
type: yesno | ||
sql: ${TABLE}."damage_cash" = 'あり' ;; | ||
} | ||
|
||
dimension: age_aggrieved { | ||
label: "被害者の年齢" | ||
type: string | ||
sql: ${TABLE}."age_aggrieved" ;; | ||
} | ||
|
||
dimension: sex_aggrieved { | ||
label: "被害者の性別" | ||
type: string | ||
sql: ${TABLE}."sex_aggrieved" ;; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
include: "/views/extend_base.view" | ||
|
||
view: hit_bicycle { | ||
extends: [extend_base] | ||
sql_table_name: "NARA_CRIME"."hit_bicycle" ;; | ||
|
||
dimension: age_aggrieved { | ||
label: "被害者の年齢" | ||
type: string | ||
sql: ${TABLE}."age_aggrieved" ;; | ||
} | ||
|
||
dimension: job_aggrieved { | ||
label: "被害者の職業" | ||
type: string | ||
sql: ${TABLE}."job_aggrieved" ;; | ||
} | ||
|
||
dimension: lockup { | ||
label: "施錠関係" | ||
type: yesno | ||
sql: ${TABLE}."lockup" = '施錠した' ;; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
include: "/views/extend_base.view" | ||
|
||
view: hit_bike { | ||
extends: [extend_base] | ||
sql_table_name: "NARA_CRIME"."hit_bike" ;; | ||
|
||
dimension: damage { | ||
label: "現金以外の主な被害品" | ||
type: string | ||
sql: ${TABLE}."damage" ;; | ||
} | ||
|
||
dimension: lockup { | ||
label: "施錠関係" | ||
type: yesno | ||
sql: ${TABLE}."lockup" = 'キーあり' ;; | ||
} | ||
|
||
dimension: antitheft_device { | ||
label: "盗難防止装置の有無" | ||
type: yesno | ||
sql: ${TABLE}."antitheft_device" = 'あり' ;; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include: "/views/hit_bike.view" | ||
|
||
view: hit_car { | ||
extends: [hit_bike] | ||
sql_table_name: "NARA_CRIME"."hit_car" ;; | ||
} |