1 Reply Latest reply on Jan 24, 2017 12:34 PM by Jamieson Christian

    How to filter based on user login name and SQL table

    Eric Saragosti

      Hi there,

      We're currently migrating our Cognos system to Tableau and are looking at limiting user access per page. I know that there's a way of doing it in Tableau, however that could take a very long time considering all the permutations.

      What I've done in the past for our intranet was develop a page that contains required permissions, and used it in a join to limit the data pulled into the ASP page.

      Would it be possible to do something similar in Tableau? Could I pull a record based on a table that the Tableau report could read telling the report what to filter out.

        • 1. Re: How to filter based on user login name and SQL table
          Jamieson Christian



          User-based access control, based on a security table, is totally feasible. Tableau has a function USERNAME() that tells you the username of the person who is logged in. This function can be used in any type of filter, including Data Source Filters (for the ultimate in row-level security).


          You can build a JOIN either by writing a Customer Query for your data source, or using Tableau's JOIN interface to join your main data source with your security table. Your security table should identify users consistent with how they are returned by Tableau's USERNAME() function. (So if Jane Doe's username looks like "JANE.DOE" in Tableau, it should look like "JANE.DOE" in your security table.) Once you have a column in your JOIN'd data that contains the username, you can easily build your filter to compare it to USERNAME().


          For more information, here are some useful Tableau help articles to get you started:

          Data Security

          Restrict Data Access with User Filters and Row Level Security


          I hope this helps.