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.
Actually this is more wanted, I believe.
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.
if [Table Name]="Obesity.csv" then [State] end
if [Table Name]="Obesity.csv1" then [State] end
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.
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.
if [Table Name]= "Obesity.csv" then "All US" else [State] end
Add Comment if you have any questions.
Enjoy Tableau !!