This blog post was inspired by a recent question in the Tableau Community Forums about sending values via URL filtering.
The question https://community.tableau.com/s/question/0D5cw00000MFRtNCAX I was asked about how to philtre using parameter values when they’re sent from ReactJS. Obviously, there is confusion on the Tableau side about what is a filter? What is a parameter? And what is a dimension?
And because those three things mean different things in Tableau, I’ve created a sample workbook to show how to use those.
But first I needed some fake data to create my sample workbook. So I asked Claude for some data and it generated a file of 80 records with fake values and dates for some ticker values
From there, I could easily create a workbook that has three sheets:
- Filtering data using a dimension
- Filtering data using a parameter in the traditional way
- Filtering a parameter that contains comma-separated values
So if I want to filter based on dimension values, I can just append the dimension name and the values as a comma-separated list in the URL like this.
https://public.tableau.com/app/profile/visualisedata/viz/url_filtering/dimension?ticker=AAPL,AMZN
But if you are truly filtering through a parameter, then a parameter is a single value only. You would have to change the design of the workbook to add a parameter and create a calculated field which uses that parameter as a philtre in order to get something like this.
Obviously, the problem with parameters is they are a single value only, so it feels like you can only filter based on a single parameter value.
If you’re creative enough, or inventive enough, you can also get around the “single value parameter problem”. But you cannot provide a parameter with a comma-separated list because that has to be URL encoded. So we need to come up with another separator character. In this example, I’ve used the pipe character, I’ve used parameters, and some more logic in a calculated field to philtre a parameter that has multiple ticker values into the right values.
So you can see that there are many different ways to philtre based on values being passed through the URL. It just depends on how your workbook is built and what sort of values you need to pass. But a traditional parameter in Tableau will only have a single value, and that might mean that you can only philtre for a single value or you need to create some other calculated fields to be able to understand multiple values. And then use a different character (i.e. not a comma) as the separator on those values.
And if you haven’t guessed by my links already, the workbook is on Tableau Public, it’s available for download, and you can see how I’ve built all these things very easily.
https://public.tableau.com/app/profile/visualisedata/viz/url_filtering/About