Having had some time working with Tableau, i have found some of the charting features that Tableau provides is very impressive and easy to use once you get used to it. Sparkline chart is one of those charts. Here is how to create your basic sparkline chart for beginners of this tool.
We will start with sample data set (superstore subset) that comes with Tableau installation:
In the worksheet, we will bring 1 dimension and 2 measures to the 'Row' section. The report will look like the following as soon as I am done with dragging region and sales (drag twice) over:
Then bring the date over as well by dragging Order Date over to the column section. By default, it automatically adds year function to order date and the graph shows 2 identical lines per region because of the 2 sales measures
Then click on one of the measure and do 'Add table calculation'. Here we are setting it as 'Moving Calculation' in the calculation type and choose Average for aggregation. I selected previous 5 months and check the box 'Include current value'. This is to calculate the moving average of sales for the previous 6 months including current month.
Then drag each of the measures and drop then under the axis section of the graph as you can see it gets highlighted when you move the cursor over.
After that the graph automatically becomes the following. You can change the formatting, hide the axis labels if you wish or change the colors of the 2 lines as you wish. In my case, i changed the Date function from year to Month, because that's my intended moving calculation.
This graph will provide user with visuals that displays the sales per region per month as well as it's moving 6 month average on the same chart as sparklines.
Thanks
Until next time..
0 comments:
Post a Comment