Let’s get started deciphering this week #WoW Challenge.
Viz to Create:
Let’s decipher based on the image
- US Map we need to show in Tile Grids.
- Inner Square is for year 2018 and Outer Square is 2017.
- Show the Change in YoY % with Arrows Up and Down.
- Color the Tiles Based on Profit Ratio.
To start the challenges we need two files , One is Creating US Map in Tiles and other one to colour the Tiles based on Profit Ratio Change.
US Map Tile Grids – Scaffolding:
There is an awesome blogspot written by Brittany Fong on how to create US Tile Map make sure to check the same. Based on the findings and learnings adopted from Brittany Fong blogspot i have extracted the data which is used for scaffolding and created a separate Datasource which will be helpful to create a US Tiled Map.
Tableau Preferences File:
In order get the mentioned Color palette, we need to create a custom Color Palette. Follow the below steps to create the same
Step 1: Jacob Olsufka Created an awesome workbook covers the Color palettes. Click on the below link to open the workbook
Color Palettes for Tableau
Step 2: Click on Copy Text
Step 3: Once after clicking on the Text, you will be redirected to Dropbox. You can download the file called “Preferences.txt” to your local machine
Before creating Custom Color Palette read this article by Tableau How to create custom colour palettes using Tableau
Step 4: If you already have custom colours used in preferences (.tps) file then follow the step 4.1 or if this is the first time you are creating custom colour palette then follow step 4.2
Step 4.1: Since you already modified the .tps file (Location : Documents/My Tableau Repository/preferences.tps) just we need add the Color palette coding to the existing tps file
- Open the preferences.txt file which you downloaded in Step 3. Once you open you can find the coding like below
Close the Tableu Instances while doing this Activity
2. Copy the xml Code From first instance of <Color-palette to last instance of </Color-palette> i.e before and after preferences tag
3. Once you Copied the xml Code –> Go to My Documents / My Tableau Repository –> Right click on the Preferences.tps –> Open with Notepad or notepadd++ or sublime text (any Text editor Application)
4. You can see already you added certain coding in the tps file , paste the Copied text after the last Color-palette tag
5. Save the preferences.tps file and close it.
Step 4.2: If you didn’t create any custom colour palette as of now follow the below steps
- Rename downloaded preferences.txt file to preferences.tps
- Copy the file
- Go to Documents/Tableau Repository –> Paste the file
- you will get popup saying to replace the file –> Select OK
Step 5: Once you completed 4.1 or 4.2 , Open the tableau Desktop you should be able to see the Custom palette’s you added to tps file
How to test it
1. Open Tableau Workbook –> connect to sample superstore –> drag Orders –> go to Sheet 1–> Drag sales to colour –> Edit colours –> colour dropdown you should get the list of colour palettes you added in .tps file.
Now we have the files and colour palette required for creating the visualization. So let’s get started
Step 1: Connect to Sample Superstore and US Tile map join on State field
Step 2: Drag Space and Row to Dimension Section
Step 3: Create a calculated field to compute Profit Ratio
Step 4: Drag Space to Columns and Row to Rows –> Select Entire View
Step 5: Drag Order date to Filter –> Select Year –> Select 2017 and 2018
Step 6: Drag State abbreviation to Text , profit Ratio to Colour and Change marks section to square
Step 7: Click on the profit ratio legend –> Edit Color –> adjust the parameters as mentioned below
Step 8: Analysis –> Stack Marks –> Off
Step 9: Drag Order date to Size –> Swap the 2017 and 2018 years
Step 10: Click on the Size Legend –> Edit the size so that our view align perfectly to what has been show in the challenge
Step 11: Drag Profit Ratio –> Text –> Right Click on the Profit Ratio –> Quick Table Calculation –> Difference –> Again Right Click on the Profit Ratio –> edit Table Calculation –> Arrange the parameters as mentioned below
Step 12: Click on Text and Select the Parameters mentioned below
Step 13: Click on Colour in Marks Card –> Select the Color Border –> White
Step 14: Right Click on the Profit Ratio which is on text Section –> Format –> Pane –> Numbers –> Custom Format –> Enter the Format like below
Step 15 : Arrange your tooltips like below (Add state name to get the same in Tooltip)
Once you have done the above steps you will get the required view,Do little formatting add to the dashboard so that your challenge will be completed
After doing all the formatting your view should look like below
Hope this helps. If this blog helps you to Solve the Challenge kindly tag me @NaveenBandla2 along with the contributors
@AnnUJackson, @LukeStanke, @lorna_eden, and @curtisharris_! ,along with hashtag #WorkoutWednesday2019