Skip to content

Tableau pass the date parameter in url

  • by

1. Overview

In Tableau pass the date parameter in url, by appending them as query parameters.

You can pass a date parameter in a Tableau URL by appending the parameter value to the URL in the correct format. This allows you to control the parameter directly via the URL, which is useful for embedding dashboards or linking to specific views. Here’s a step-by-step guide on how to do this:

2. Syntax – Tableau pass the date parameter in url

The basic syntax for passing parameters in a Tableau URL is:

http://<TableauServerURL>/views/<WorkbookName>/<ViewName>?:parameter_name=value

If you want to pass a date parameter, you can use the following syntax:

http://<TableauServerURL>/views/<WorkbookName>/<ViewName>?:parameter_name=yyyy-mm-dd

2.1. Identify the Parameter Name:

First, ensure you know the exact name of the parameter you want to pass. For example, if your date parameter is FROM_DATE, you’ll use this in the URL.

2.2. Format the Date Parameter:

You must format the dates in URLs correctly, usually in YYYY-MM-DD format. However, the format may vary based on how you set up the date in your Tableau workbook. Common formats include YYYY-MM-DD or MM/DD/YYYY, depending on your parameter configuration.

Tableau pass the date parameter in url
Tableau pass the date parameter in url

2.3. Construct the URL:

Tableau URLs typically look something like this:

http://<your-server>/views/<workbook-name>/<view-name>

To pass a date parameter, append ? followed by the parameter name, an equal sign, and the value. For multiple parameters, use & to separate them.

Example:

http://your-server/views/SalesDashboard/SalesView?FROM_DATE=2024-08-24

If you also had a TO_DATE parameter, you could pass it like this:

http://your-server/views/SalesDashboard/SalesView?FROM_DATE=2024-08-24&TO_DATE=2024-08-31

2.4. URL Encoding:

Always make sure to URL encode any special characters (e.g. Replacing spaces with %20).

2.5. Applying the Parameters:

When you access this url, Tableau will automatically apply the passed parameters to the relevant filters in the dashboard.

2.6. Handling Date Formats:

If your Tableau parameter expects a specific date format, ensure your URL date matches that format. If there’s a mismatch, Tableau might not apply the filter correctly.

2.7. Testing:

After constructing the URL, test it in a browser to ensure that the correct data is being filtered in your Tableau view.

3. Conclusion

This method is useful for creating dynamic links or integrating Tableau dashboards with other web applications where dates or other parameters need to be passed directly through the URL.

By using this approach – Tableau pass the date parameter in url, you can share or bookmark Tableau dashboards with pre-set date ranges or other parameters to suit different needs. You can find our code samples in our GitHub repository. To learn more about Tableau, refer to these articles.

Leave a Reply

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