Sometimes your requirement demands that you display charts based on user selection. it is very easy to accomplish this task in Tableau.
Steps to display charts based on selection in Tableau
- Connect to data source
- Create charts
- Create a parameter
- Create a filter which uses this parameter on each chart
- Display charts on the dashboard and show the filter
As a first step, I will create 2 charts.
- Open Tableau 9.1 or the version on your machine
- To add datasource click on excel. Browse to your data source. This example uses Sample-Superstore.xls. This data source comes with Tableau installation.
- If you open this xls file in ms-excel, you will notice that this file contains 3 sheets – Orders, People and Returns.
- In Tableau, you can see these 3 sheets under Sheets. Double click on Orders and click on Sheet1 all the way at the bottom
5. Fields from the excel sheet are been divided under Dimensions and Measure. If you want to learn about Dimensions and Measures in detail , visit my blog on Dimensions and Facts
6. Drag Order Date from the dimension to the Columns shelf and Profit from the measures to Row shelf. From Show Me select bar chart
Bar chart will appear as the one below
7. Rename Sheet1 as BarChart
8. Right click on the sheet you just created and select duplicate sheet. Change the name of the Sheet to Trend
9. From the “Show me” select the Trend chart
10. Now you have created 2 sheets Bar and Trend. Now will work on showing these charts dynamically by selecting options from the drop down list
Steps to Show charts based on Selection in Tableau
- Right click on the measures or dimensions area and select Create Parameter
2. Give the name to this parameter. I will give “Select a Sheet”. Select Data Type as String. From the Allowable values, check the radio button for List
3. Under List Values add values as All, BarChart and Trend. These are the names of the sheets we created earlier.
4. This parameter will show up all the way at the bottom of the sheet below Measures area
5. Navigate to Dimension or measure area and select Create Calculated field. I will name this field as Show
6. In the calculated field, select the parameter created earlier “Select a Sheet”. This calculated field will show up in the Dimensions area.
8. In the box “Enter Text to Search” enter BarChart
9. Your chart may disappear. Right Click on the empty space in the chart area and select parameter, to show the value of the parameter
10. Your parameter will show up on the right side. From the parameter, drop down select BarChart and your BarChart will show up
11. Follow the same steps for Trend sheet too
12. Now create a dashboard. Double click on the sheets BarChart and Trend to left to place them on the dashboard. Use the parameter drop down to display the charts based on the selection.
13. Click on each chart and select floating. This will help you in adjusting in size of the charts and their placement on the screen.
Curious to know how to accomplish this in QlikView, visit How to display charts based on selection in QlikView