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.

 

 

 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.

f:id:skn_0410:20181009082505p:plain

 

1.2 Create Dual Axis

And what we want to do is swap these maps.

f:id:skn_0410:20181009085251p:plain

 

1.3 Now we have "Table name" from Union feature which brings 2 x 2 charts.

f:id:skn_0410:20181009085048p:plain

 

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".

f:id:skn_0410:20181009084855p:plain

 

 

1.5  Set Dual Axis.

f:id:skn_0410:20181009085426p:plain

 

== 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.

f:id:skn_0410:20181009085642p:plain

 

2.3 Create two Actions.

2.3.1  "State.0" to :State1."

f:id:skn_0410:20181009085830p:plain

 

2.3.2  "Target to Table Name"

**** This is a key to kick the trigger of swapping two Tables.

f:id:skn_0410:20181009090034p:plain

 

Click any "State" on Top map

 

f:id:skn_0410:20181009090214p:plain

 

Brings another table name which has County detail in it.

f:id:skn_0410:20181009090302p:plain

And another click on any County.

Table is alternated.

 

f:id:skn_0410:20181009090403p:plain

 

Clean up the title and Label.

Title

if [Table Name]= "Obesity.csv" then "All US" else [State] end

 

f:id:skn_0410:20181009091014p:plain

 

 

https://public.tableau.com/profile/shin.murakami#!/vizhome/Regional_Single_sheet_18_2/Dashboard1?publish=yes

 

Add Comment if you have any questions.

 

Enjoy Tableau !!

 

f:id:skn_0410:20180223115051p:plain