One Click Zoom IN / OUT on the Map
Long time no write : )
The other day, I uploaded the Video-clip of one-click zoom in / out.
There were unexpectedly lots of replies over weekend that includes the requests to explain the steps.
After lots of trials and errors, finally achieved one-click State zoom in& out actions... ワンクリックズームイン&アウトようやく分かった。 #tableau #タブロー pic.twitter.com/tF460SC6fk
— Shinichiro Murakami (@smurakam0201) October 6, 2018
Actually this is more wanted, I believe.
#tableau #タブロー I got lots of replies on one-click zoom in/out. I think this is more wanted version. Also I am now preparing the blog post to explain the steps. pic.twitter.com/ONcRqpuj19
— Shinichiro Murakami (@smurakam0201) October 8, 2018
Here is steps.
I used two main technicques.
1. Union and Dual Axis
2. Action with Taget
== Create Union and Dual Axis ==
1.1 Create Union.
1.2 Create Dual Axis
And what we want to do is swap these maps.
1.3 Now we have "Table name" from Union feature which brings 2 x 2 charts.
1.4 Create conditional Calc Fields.
State.0
if [Table Name]="Obesity.csv" then [State] end
State.1
if [Table Name]="Obesity.csv1" then [State] end
County.1
if [Table Name]="Obesity.csv1" then [County] end
** Don't forget to assign geo role for respective fields. ***
1.5 Put "State.0" into primary Axis and "State.1" and "County.1" into Secondary Axis instead of "State" and "County".
1.5 Set Dual Axis.
== Action With Target ==
The question is how to make "Trigger" to swap Two "Tables" (Top and Bottom)
2.1 Create another Calc Field.
Target
if [Table Name]="Obesity.csv" then "Obesity.csv1"
elseif [Table Name]="Obesity.csv1" then "Obesity.csv"
end
2.2 Put Target into Detail.
2.3 Create two Actions.
2.3.1 "State.0" to :State1."
2.3.2 "Target to Table Name"
**** This is a key to kick the trigger of swapping two Tables.
Click any "State" on Top map
Brings another table name which has County detail in it.
And another click on any County.
Table is alternated.
Clean up the title and Label.
Title
if [Table Name]= "Obesity.csv" then "All US" else [State] end
#tableau #タブロー I got lots of replies on one-click zoom in/out. I think this is more wanted version. Also I am now preparing the blog post to explain the steps. pic.twitter.com/ONcRqpuj19
— Shinichiro Murakami (@smurakam0201) October 8, 2018
Add Comment if you have any questions.
Enjoy Tableau !!