Parsing URL Parameters in Tableau Desktop

Published: 26 Oct 2016
Last Modified Date: 06 Sep 2019


How to parse URL parameters in Tableau Desktop.

For example, how to get values for "Category", "Media" or "Programme" in the example URL: /www.example.url/?Category=brand&Channel=paid%20search&Media=Bing&Programme=PG&Region=National


Tableau Desktop


Use regular expressions in order to capture the value of URL parameters. In Tableau this can be achieved with the built-in formula REGEXP_EXTRACT_NTH, for example: 
REGEXP_EXTRACT_NTH ([URL], '(Category=)(.*?)&', 2) 

This formula will capture the value of the "Media" URL parameter. To capture the value of other parameters please just replace the parameter in the formula, for example for "Media": 
REGEXP_EXTRACT_NTH ([URL], '(Media=)(.*?)&', 2) 

And the following formula will capture the value of the "Programme" URL parameter. 
REGEXP_EXTRACT_NTH ([URL], '(Programme=)(.*?)&', 2) 


Additional Information

For more information about Regular expressions, see Additional Functions in Tableau Help.

To view the above steps in action, see the video below. 
Note: the video has no sound.

Discuss this article... Feedback Forum
Did this article resolve the issue?