It has been tough earlier to analyze time in live scenarios and Tableau has helped us solve this issue through a great extend with the help of various visualizations like -- Line graphs, Area graphs, Pages shelf — to name a few.
Slope Graph is one such way through which you can see the trend of your Dimensions between a period of time. So, for example if we have to analyse the Sales of various Sub Categories through multiple Months then we made a Line graph like below :
I took Month(Order Date) in Continuous with a Discrete Axis in Columns and Sales in Rows with Sub Category in Color Shelf:
But this visualization looked very clumsy with lots of information on it. Also, this visualization is showing the entire Month of my Data set. So, I even added a Date parameter so that, I could give the clients a Start date and an End Date to choose from. But, rescently a Client asked me to create a viz where they could analyse the growth between the two dates. To be very precise, they didn’t want how the trend of growth has been between the dates (i.e not all the rise and the fall) but, just the movement from the Start and the End Date (and like always- the dates had to be dynamic). After a lot of internet research I came to know that the answer is Slope Graph in Tableau.
So, let’s move ahead and create a Slope Graph in Tableau which will show you how the movement has been between the Dates that you choose in a Slope. Like always we will be using Sample Superstore.xls for this viz with Orders table to work on.
Connect Tableau to the Data set and drag Order Table to the preview space and go to the sheet:
Step – 2:
Take Order Date (Month – Continuous) in Columns and Sales in Rows with Sub Category in Color Shelf.
Step – 3:
Hold on to Ctrl in your Keypad and duplicate the Month(Order Date) in the Column Shelf to the Filter Shelf and you will get a dialogue box like below:
Choose Range of Date from the above dialogue box to get another dialogue box like below:
Click on Apply and then Show filter.
Step – 4:
Now to highlight only the First and the Last Dates that are chosen through the Filter, we need to create a calculated field like below:
The result of this calculated field will be a table calculation in Boolean which appears in measures. Since we only want the First and the Last values in the visualization we will put this new created calculated field in the Size shelf and from the indicator HIDE the FALSE value:
And now for the Final touch, go to the Month(Order Date) which is in Continuous in the Column Shelf and change it to Discrete. The Slope Graph is ready.