Last Modified Date: 03 Jan 2019
- Tableau Desktop
AnswerUse Initial SQL to query the database using the Tableau Server username. Follow the steps below:
- Connect to a data source that supports Initial SQL
- Enter the connection details.
- Open the Initial SQL options.
- Enter the commands that will pass the Tableau parameters such as [TableauServerUser] to the database.
- Click OK and connect to the database.
- Connect to the new table created by the commands set in the Initial SQL.
- Create a new connection and join the new tables to the table created by the Initial SQL
Additional InformationThis is just another method for implementing row level security.
The table created by the Initial SQL should only contain data for the username passed with the Tableau parameters. Joining to this table will then only create a data source that has data relevant to the user logged in without needing to apply any type of user or group filter. The filtering will be performed by setting the conditions in the SQL when creating the connection.
User must have knowledge of how the SQL required for their respective database. The tables/data must also be prepped to a certain extent for this work, such as containing a Username column that matches the Tableau Sever name or some logic in database that will know how to process and return the expected tables.
Discuss this article...
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Training and Tutorials