In today’s blog, we will learn about Bump Chart in Tableau. A Bump chart is used to visualize changes in rank over a period of time. Bump chart have very simple use and application in Tableau:

For this chart, I have used the world economic freedom data shared for #makeovermonday on http://www.makeovermonday.co.uk/data/ for last week makeover.

Step 1: Import the world economic freedom data into Tableau which I transformed into following format:

Step 2: Create a calculated field called rank on the score field using rank() function of Tableau:

Step 3: Drag Year (convert the Year to date format) to column shelf (I filtered the year from 2006 to 2015) and convert Year into discrete form and drag rank twice into rows. Then drag Index type column into filter and filter for “overall” Type and drag countries column into colors under marktype.

Step 4: For both the rank, change the calculation type by clicking on compute by and selecting countries and change the graph type to dual axis and use synchronise axis to have axis in sync

Step 5: Reverse the axis using edit axis option and change the graph type from automatic to circle for second Rank column:

Step 6: I set the filter for countries as well to display top 10 ranks and few changes in formatting then it will look like below:

That’s it our bump chart is ready

Final output is shared on Tableau public path here

Do subscribe on blog to keep receiving updates.

Thanks 🙂

 

In today’s blog, I will guide you through how to use sigmoid function and create an Sankey chart using Tableau. Sankey diagrams are specific type of flow diagram in which the width of the arrows is shown proportionally to the flow quantity. Sankey diagram put a visual emphasis on the major transfers or flows within a system.

Below is the illustration of how sankey diagram looks:

This chart has 3 components:

1- Country on left side in stack bar format

2- Flow diagram in center showing the flow

3- Players name on the right side in stack bar

This graph shows depicts the Cricket players and the country where they belong.

Below is the final output of my Sankey chart using Tableau:

Since we have fair idea of Sankey diagram and what it shows lets get going and learn how to make one:

Step 1:

In our example we will consider top 20 ranked ICC cricketers for One day internationals for 2016 and 2017. Import the excel file into Tableau (Below screenshot of data)

Step 2:

Once data is imported we need to define the number of points to draw a smooth sigmoid curve. We will now create a calculated field “Point” and assign 1 for 2016 records and 49 for 2017 records:

Step 3:

For sigmoid curve, the coordinate values should be in between -6 and +6. To generate that curve we will create following calculated fields which we will use to create the curve:

Index = index()

X = 0.25*[Index]-6.25

Sigmoid = 1/(1+EXP(-[X]))

Curve = WINDOW_MIN(IF FIRST()=0 THEN MIN([Rank]) END)+[Sigmoid]*[Change]

Step 4:

Next is to create a bins (padded) based on Point. This will create additional 47 points which we need to create the curve through data densification

Step 5:

Drag Padded into rows and right click –> select show missing values then drag padded to details and then drag index into details as well and make it compute using Padded and similarly drag X into columns and curve into Rows in the sheet then make them compute using padded for both X & Curve as shown in below screen shot:

After bit of formatting, the chart will look like this with sigmoid curve with 2016 vs 2017 rankings of top 20 ODI batsmen:

 

Our sigmoid curve for Sankey graph is ready. Now, our next step should be to create one worksheet with all the countries and other stack bar with names of the players. Then we can add all sheets in dashboard to get desired Sankey flow chart output.

you can find tableau workbook here

Thanks!!

Do subscribe to blog for getting regular 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