How to add a reset button to your drill down bar chart

In my previous post (How to Create a Drill Down bar chart using parameter actions) we utilised parameter actions to create a user friendly drill down bar chart, whereby your user can select a bar, and see it split into the subcategories that make it up. Today we are taking this slightly further so follow along that first post if you haven't already!

Step 1: Create the Reset Button Worksheet

In a new worksheet, create a calculated field

Name the field Reset Button, and type in "Reset" into the pane.

Drag this new field onto 'Text' in the Marks Card, fill entire view, and align center.

You should now have a sheet looking something like this:

Step 2: Create your dashboard

Create a dashboard, and pull your bar chart sheet onto it. Annoyingly, you will have to edit your parameter actions that make the drilldown work, as these their 'source sheet' is currently the worksheet, not the dashboard. Select Dashboard, then actions:

Click on edit Parameter Action, and change the source sheet to your dashboard name:

Now pull on your reset button worksheet to the dashboard, give it a background to help spot it, and hide the title by right clicking the title and selecting hide.

Step 3: Make the button functional!

Because the button's calculated field technically gives it the value of 'Reset', we can add a potential 'Reset' value to our parameters list of selected options. As there is no category in a bar chart named 'Reset', this will revert the view back to original! Hopefully... Let's give it a go.

1) Add 'Reset' as an option in our 'Selected Category' parameter by first going to the sheet, and selected edit parameter:

From here, simply type 'Reset' into the value box:

Within your parameter, Reset will now be an option. This will already reset the view so you could leave it here if you want to control everything with the parameter drop down select. But that isn't enough for us! We want to click on the button, and have this change the parameter to Reset, which in turn will reset the chart.

2) Head back into Dashboard actions, and select 'Add Action', followed by 'Change Parameter'. Title it Reset Button, select 'Reset Button' as the source sheet, have action run on 'Select', use 'Selected Category' as your target parameter, and have 'Reset Button' as your source field. Click OK! and voila - You now have a bar chart that you can drill down into, and reset, without the need for a clunky parameter dropdown list!

From here all there is left to do is format to your hearts content:

Author:
Dominic Brady
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab