This week #workoutwednesday challenge was set up by Rody Zakovich, it was about creating a connected scatter plot on hover which allows user experience (UX) feature not available in natively available in product.

Requirements

  • Dashboard size is 600 x 600
  • The Scatter Plot has Sales by Profit for each Category and Year
  • When a user hovers over any category, all years for the category will be connected by a line
  • The line connects the categories by year in ascending order

Data for the workout can be downloaded from here

Here is my output for the challenge (Click on Image for interactive version):

The Challenge seems to be simple but the actual challenge is to create the effect without affecting other categories i.e. they should still be visible and not disappear

Let me share the steps I performed to achieve this effect which I think is cool way to showcase scatter plot for user experience:

Step 1: Data Preparation

Since dataset has 3 categories, we will union the orders sheet twice with original data with required fields of Order_date, Category, sales and profit.

This union of dataset will help us to create the action filter in further steps.

Step 2: Calculated Fields

CalcProfit: we will use LOD function to create average of profit values on the basis of Category, Table Name, year of Order date) since we have duplicated the numbers average will help us get original values

CalcSales: we will use LOD function to create average of sales values on the basis of Category, Table Name, year of Order date) since we have duplicated the numbers average will help us get original values

SalesCategorywisesales: This field is to aggregate the data on each category using the Table name field

SalesCount: This field is conditional field to show the line chart in our next chart

CalcCategory: Final field of mapping each category to table name for Action Filter

Step 3: Create the visualisation

Replicate the below Visualisation with relevant fields into rows and column shelf then create the dual axis. Post this add required field into Marks shelf for both CalcSales and SalesCount field.

 

Step 4: Add Action Filter

Last but the most important step, create an dashboard and import the sheet into dashboard. Then select the Dashboard –> Action Filter

set the action on hover on the basis of CalcCategory to Table Name

Do few changes in format and tooltip

Now we are ready with visualization with user experience which we wanted to show.

Click here for Tableau file

Thanks Rody Zakovich for this workout.

Happy Data Visualisation!!!!

Thanks for visiting this post. Please do let me know your feedback or if you have any questions about the blog do not hesitate to contact me on twitter (@Desaimithun)

Do subscribe to Tabvizexplorer.com to keep receive regular updates.

This week’s #workoutwednesday was about comparing last 2 periods sales for a sub-category using date functions with customize tooltips.

Requirements

  • Dashboard size should be 600×700.
  • The Change field should be displayed as a number, not a string.
  • Sub-Category should be sorted ascending by Change.
  • Tooltips should match exactly.
  • Prior Month and Most Recent Month should always be matching days, for example: If the max order date is 6/15/2017: the most recent month range should be orders between 6/1/2017-6/15/2017 and the prior month range should be 5/1/2017-5/15/2017.
  • Make sure your audience knows the dates in question by providing a note about the date ranges above the viz, and make sure that the date range displays match the colors of the dots in the viz..
  • Display the x-axis on top of the viz, and use the traditional x-axis space for a color legend.
  • Show the mark label on hover *for the most recent month only*. If the value for the most recent month is *lower* than the prior month, the mark label should be displayed to the left of the dot. If the value for the most recent month is *higher* than the prior month, the mark label should be displayed to the right of the dot.

Below is my attempt to meet the above requirements:

Thanks for reading 🙂

Do subscribe to blog for keep receiving updates

Being an avid follower of stock markets and thought of creating an area graph of stocks and highlighting the lows and high of the stock for the duration selected something similar to what we see on moneycontrol.com.

My output dashboard here:

Here I will show how to use LOD (Level of Detail) expression in Tableau (More information available here)

Step 1: Downloaded stock price data using getbhavcopy app, which gives an option to extract data of all the stocks at NSE or BSE with their open, close, high, low and volume. I downloaded data from 1st Jan’17 till 22nd Feb’18 data from the app. It looked liked this:

I used command prompt commands to combine all files into one file.

Step 2: Import the data into Tableau and create area graph for the date range and applied company name and actual date as filters. For this example, I applied context filter to actual date field (using add to context filter option in Filters)

Then I created 3 calculated fields to identify High and Low price for selected duration of stock company using LOD expression named Fixed using following Nested Fixed formula:

 

Step 3: Create the worksheet with dual axis as shown below:

 

Then, I integrated the worksheet into dashboard to create output dashboard where user can select any stock with date range user wants to get output with high and lows of that duration.

Thanks!

Do subscribe to my blog to keep receiving updates on new posts