Fellow Tableau Zen Master Andy Kriebel writes great tutorials, like this one on passing filters in a URL. I was using those instructions to build URLs to pass from one Tableau workbook to another and things were going swimmingly in trials until I got to my data, where I found not one, but two undocumented features of Tableau’s URL parameters.
Aliases in URL Parameters
When we set up a URL Action in Tableau and add fields to the action, if the field is a Tableau parameter or a discrete dimension that has an alias assigned, when generating the URL parameters Tableau will use the alias and not the original value. So, for example, if your field is an integer such as 201 with a string alias of MS4, Tableau will pass MS4 and not 201, like in the image above. If you have a mix of some aliases and some not, Tableau will use the aliases where they exist.
Tableau Parameters used in URL Parameters Affect Parameters in Target Worksheet
The documentation doesn’t explicitly state that Tableau can use a Tableau parameter in a URL Parameter, but we can. And one of the interesting effects is that if the target of the URL is another Tableau workbook and there is a Tableau parameter of the same name in that workbook, then Tableau will set the value of target’s parameter to the passed value. This is a useful feature for making parameters truly global. The one caveat is the issue above, if the parameter is using an alias then the alias is passed to the target, not the original value of the parameter.
There are a three ways I’ve come up with so far to deal with this:
- Stop using aliases and set up the parameter or field with the desired values.
- Set up the target to handle the aliases.
- Instead of using the parameter or discrete field with the alias as the parameter, use a calculated field that just has [myParameterOrField] as the formula so it will just have the value and not any alias.
I’m using #1. This is a bit of a letdown for me, in reading up on improving performance there are big gains to sticking with numbers and using aliases instead of strings, and having to add extra columns to the data in the case of #3 to avoid this seems to partially defeat the purpose. If you have others, let me know!
It’s always bugged me that when you copy a dimension or measure in Tableau, the XML retains the name (copy) instead of the new name you give it. This is similar to what causes your alias to not get passed in the URL filter.