過去記事「【SQL】年別総数とタイプ別割合」で作ったデータソースをもとに、Tableauで可視化します。細かいとこはやりながら覚えよう。
- 使用データ:[ Google Cloud Public Datasets] chicago_crime_data (Chicago Police Department crime data from 2001 to present)
- 期間:2010-01-01 ~ 2020-12-31(10年間)
- 棒グラフ
- ライングラフ
【テーブル】
ディメンション:Primary Count , Pimary Type, Sum year , Year , メジャーネーム
メジャー:Type Percent , データソース , メジャーバリュー
1.棒グラフ
- 列:年(year)
- 行:合計(Primary Count)
- マーク(形状):棒
- マーク(色):(Primary Type)11位以下はグレーに統一
- マーク(ラベル):(Primary Type)10位以内は「常に表示」(幅が狭いと表示されない)
積み上げ棒グラフです。項目が多いので、上位10位のみ犯罪タイプ名を表示しています。正直なところ、数が多いタイプくらいしかわからない。全体と、窃盗と麻薬が減ってるようだ。
2.ライングラフ
棒グラフの表示をラインに変えただけ。デフォは透明度60%がはいってました。
年の縦境界線がなくなった分、流れる感じで全体が俯瞰できます。レイヤーケーキみたい、狭くて表示できない項目がいくつかあって、「常に表示」を選択しても出てこなかった。狭いのかな。
犯罪件数が減っているのは、2020年コロナ流行によるロックダウンが影響しています。
<参考記事>
ロックダウンの思わぬ恩恵
(Bloomberg 2020年3月31日)「米犯罪件数減少、ロックダウンの思わぬ恩恵-家庭内暴力リスクは上昇」ロサンゼルスでは21日まで4週間の窃盗事件がそれ以前の4週間と比べ18%減少。シカゴでは警察への通報件数がその1カ月に30%減少し、ニューヨーク市の犯罪は22日終了週に約25%減った。
2020年春のロックダウン
(JETRO 2020年04月24日)「米イリノイ州、自宅待機命令を5月30日まで延長の方針、一部規制緩和も」米国イリノイ州のJ.B.プリツカー州知事は4月23日、4月30日までとなっている同州の自宅待機命令を一部修正した上で、5月30日まで延長する意向を示した。
2020年冬のロックダウン
(AFP BB News 2020年11月13日)「米シカゴに外出自粛勧告、コロナ感染急増で16日から」米イリノイ州シカゴのローリ・ライトフット(Lori Lightfoot)市長は12日、新型コロナウイルスの感染者数が急増していることを受けて、16日から3週間にわたり不要不急の外出を控えるよう勧告した。
ディメンションやメジャー、計算式、即パブリッシュ(たまに接続切れ&失敗)。ノート即コピーに縦横入れ替え、色、ラベル、Tableauはとっても便利です。簡易地図機能もあるみたい。
スタート時のデータ連携とデータ型変更も便利だな。JOINを視覚的にできるあたり秀逸。年で入れてたら勝手に1月1日になったり、時刻をサポートしていないのは置いといて。
カラーの選択も多い。色覚に特化した色味やモノクロ、Tableau10/20の色選択はカラフル。
故に、飾り付けしすぎにならないか、個人のセンスが問われる。
ピボット表計算もUIがよかったので、これを使った別のことも試したい。
<参考>
Bloomberg:米犯罪件数減少、ロックダウンの思わぬ恩恵-家庭内暴力リスクは上昇(2020年3月31日 11:57 JST)
JETRO:米イリノイ州、自宅待機命令を5月30日まで延長の方針、一部規制緩和も(2020年04月24日 シカゴ発)
AFP BB News:米シカゴに外出自粛勧告、コロナ感染急増で16日から(2020年11月13日 13:19 発信地:ワシントンD.C./米国)
********
Based on the data source created in the previous article "[SQL] Total number by year and percentage by type", visualise it in Tableau.
- Data used: [ Google Cloud Public Datasets] chicago_crime_data (Chicago Police Department crime data from 2001 to present)
- Period: 2010-01-01 - 2020-12-31 (10 years)
- Bar graph
- Line graph
[Table]
Dimension: Primary Count , Pimary Type, Sum year , Year , Major Name
Measure: Type Percent , Data Source , Measure Value
1. Bar chart
- Column: Year
- Row: Total (Primary Count)
- Mark (shape): Bar
- Mark (colour): (Primary Type) 11th and lower ranks are grey.
- Marks (labels): (Primary Type) "Always displayed" for the top 10 (not displayed if the width is too narrow)
Stacked bar chart. As there are many items, only the top ten crime type names are shown. To be honest, there is not always much to be gained from the visualisation. Overall and theft and drugs seem to be decreasing.
2. line graph
The bar graph display has just been changed to a line. The default was 60% transparency.
The vertical borders of the year have been removed so that the whole picture flows. It’s the layer cake. There are a few items that are too narrow to display and they didn't appear when I selected 'Always show'. I wonder if it's too small.
The drop in crime is due to the lockdown caused by the 2020 Corona epidemic.
<Reference article
Unexpected benefits of lockdown
(Bloomberg 31 Mar 2020) 'US crime down, unexpected benefits of lockdown - domestic violence risk rises' In Los Angeles, thefts fell 18% in the four weeks to 21 March compared with the previous four weeks. In Chicago, police calls fell by 30% in the same month, and crime in New York City fell by about 25% in the week ending 22 March.
Spring 2020 lockdown
(JETRO 24 Apr 2020) 'US State of Illinois intends to extend stay-at-home order until 30 May, with some deregulation' On 23 April, Governor J.B. Pritzker of Illinois, US, announced his intention to extend the state's stay-at-home order, which is in effect until 30 April, until 30 May, with some revisions.
Winter 2020 lockdown
(AFP BB News 13 Nov 2020) 'Chicago advised to stay home from 16 November due to surge in coronavirus infections' Mayor Lori Lightfoot of Chicago, Illinois, USA, said on 12 November that the city would be under a three-week lockdown from 16 November due to a surge in the number of new coronavirus cases. She advised people not to leave the city for three weeks from 16 June due to a sharp increase in the number of new coronavirus cases.
Dimensions, measurements, formulas, instant publishing (sometimes connection lost & failed). Easy copying, transposition, colours, labels, dashboards, tableau is very useful. There also seems to be a simple map function.
The data linking and data type change on startup is also useful. The exception is that it doesn't support time of day, or that it automatically adds to 1 Jan when I put it in the year.
There are many colour choices. The colour selection is colourful such as monochrome and tableau 10/20 and more.
Therefore, it is a matter of personal taste to avoid over-decorating. The pivot spreadsheet also had a good UI and I would like to try something else with it.
<Reference
0コメント