Thank you Ken for your prompt response. It will be great if you can respond to it by evening.
The key to toggles is that the toggle has to perform some sort of filter. It can't be driven by a parameter. So, for instance, if you wanted the toggle to change from showing one measure to showing another, it's not a simple process because there has to be data to filter. I'll use this as a simple example with the Superstore data set. I'll make the toggle so that it will show either Sales or Profit.
Because we need to filter data, I'm essentially going to duplicate my data. I'll start by creating a new data set that looks something like this.
I'll then connect to Superstore and this new data set. I'll join them via a join calculation where 1 = 1. This will essentially duplicate all the rows--one set for each row in the toggle data set.
Note: You could do this with a union as well, but you'd need to create a calculated field for "Option" based on Table Name.
Next, let's create a calculated field that will change the measure we're using based on the Option.
// Select a measure based on the option selected.
IF [Option]="Sales" THEN
Then we'll build a view based with this measure. I'll just create a simple area chart.
Now we need to create our toggles. This will be a new sheet. For this to work properly, we need there to be an axis so create an x and y axis by just typing "0" into the column and row shelves.
Now change the mark type to Shape and drag Option to the shape card.
Next we'll assign custom shapes to each value. I have a couple different options available here, but you could also create or download your own: https://www.amazon.com/clouddrive/share/YCC9Q8l2vcmJfVB3aLHfK5FanXnppjYqDcX9iPmxbYp
Now turn off all lines and hide headers, etc.
Next, create a calculated field which will give us the target value of option when we click it. So, for instance, if it's currently set to "Sales", clicking it will change it to "Profit"
// Option we'll change to when we click the toggle.
IF [Option]="Sales" THEN
Drag the Target Option field to the detail card so we can use it in a filter action.
Now create a filter action on this sheet that looks like this:
Now click on the toggle button and you'll see that it applies a filter.
Right-click on the new filter and set it to apply to all sheets.
You can now click on the toggle and it will change the image each time, while also changing the filter. You will only ever have one option--Sales or Profit. It can never be both.
Now put both your chart and your toggle sheets on a dashboard.
Now, when you click on the toggle, you'll see that it switches between the two measures on the chart.
Hope this helps! If you have any questions, please let me know. If this answers your question, then please be so kind as to mark my response as the "correct answer" so we can close this thread and so others can easily find the answer if they have similar questions in the future. Thanks!
Toggle.twbx 2.4 MB
I tried accessing the Tableau Public workbook, but unfortunately wasn't able to do so because I have an older version of Tableau. Will it be possible for you to convert the workbook into Tableau V 10.3 and send it over to me so that I am able to open it.
Thank you Ken! This detailed explanation is really helpful. I was able to replicate it with Superstore dataset.
However, I need some help to decide to decide data filters (or "Options") for my Dashboard.
I currently have visualizations which show a System View chart (See Screenshot 1). I need to be able to give the end users an option to switch on/off this system view, very similar to your Grid Lines "On/Off" option in Tableau Public workbook.
Screenshot 1 - Visualization with System View "On"
Screenshot 2 - Visualization with System View "Off"
Screenshot 3 - Current Oracle Table and Join
I think you tried sending your Tableau Packaged workbook so that it will be compatible with v10.3. But I didn't receive it.
I have attached my packaged workbook to the original post.
I think I'd need to see your workbook in order to figure out how exactly to make this work.
I have attached my Tableau packaged workbook to my original post on Tableau
Please let me know if you Are able to open it.
I don't see it attached here.
Not yet, sorry. Will do that today for sure.
Which worksheets in the workbook are you referring to? There are lots in the workbook, so I'm not sure what's what.