Parameter Actions – How to increase the value of a parameter?

While staying at home with our kids due to Covid-19, I was thinking about a way to inspire the kids using Tableau. I started building a dashboard where the kids can count building blocks of different colours. By clicking on the building blocks they will get stacked into a tower (or you can also see it as a barchart).

To make this work I needed parameter actions and I will explain how I made use of them.

When using this dashboard you need to click on the four building blocks on top of the dashboard. Behind each of these blocks is a parameter with a defined range from 0 to the total number of blocks of the respective color. When opening the dashboard the parameter is set to 0. By clicking on the block the parameter value increases by 1.

Image 1: Explanation of Dashboard (using collapsable containers)

Below the four building blocks you can click onto you can find two charts. The left one shows the unsorted building blocks, the right one shows the towers you built already. Both charts work by using a filter. Each of the blocks owns a number counting from 1 to the total number of blocks of the respective color. For example there are 12 green building blocks and each green block owns a number between 1 to 12. When the parameter for green blocks is 8 the filter ensures that the left chart only shows 4 green building blocks and the right one shows the 8 blocks already selected.

So what do you need for this parameter action?
– a source sheet
– a source field
– a targer parameter

First you need one sheet for each of the blocks (source sheet). It is important that this sheet includes the source field that makes an impact on the target parameter. When you look at the picture below you can see that I used a calculation “increment + 1” (set on details) as source field. At the end when putting this sheet onto your dashboard you will want to get a reaction when hovering over or clicking on it.

Image 2: source sheet

Next you need a (target) parameter with a defined range. The next image shows my parameter settings.

Image 3: parameter settings

Then you need to define the source field. I used a calculation which takes the current value of the parameter and increases it by 1.

Image 4: source field

When all these steps are done you need to set up the parameter action on your dashboard. Go to menu > Dashboard > Actions and add a new action that will change your parameter. The dialog box “add parameter action” appears and you will need to define your source sheet (in my case it is the sheet with the single building block on it), the user behavior that runs the action (hover, select, or menu) and the source field that affects the parameter.

Image 5: add/ edit parameter action

You need to do all These steps for all your blocks (4 blocks with different colors, 4 parameters, 4 source fields, 4 parameter actions). Now every time you click on one of the four building blocks on your dashboard your parameter value will increase by 1.

I also added a “Start new” button which works through parameter Actions, too. Again I needed
– a source sheet (Image 6)
– a source field (Image 7)
– a target parameter (in this case it affects the same Parameters I created earlier – see Image 3)
– a parameter action on your dashboard (or in this case 4 parameter actions – one for each Color. see Image 8)

My source sheet contains the source field “Start new” which is 0 and it sets all Parameter values back to 0.

Image 6: start new source sheet
Image 7: start new source field
Image 8: start new – parameter actions

You can download the viz here to see all calculations and parameter actions in more Detail: https://public.tableau.com/profile/datarock#!/vizhome/Buildyourtower/Buildyourtowers

Thanks for reading this article and feedback is welcome.

1 thought on “Parameter Actions – How to increase the value of a parameter?

Leave a Reply

Your email address will not be published. Required fields are marked *

Twitter
Pinterest
Instagram