2 Replies Latest reply on Apr 29, 2016 8:42 AM by Kevon Houghton

    Parameter behaving oddly

    Kevon Houghton

      I have a workbook with a Parameter (EmployeeID).  This workbook has multiple worksheets, and one dashboard.  There are multiple data sources, one for each worksheet. Each of these is custom SQL, connecting to MSSQL.  The parameter is used in the custom sql to filter results to the current user. 

       

      The worksheets are things like: Missed Meetings, Sales by State, Outstanding Orders, etc.  One worksheet is a list of employees. These employees are subordinates to the person viewing the workbook and acts as a filter on the other worksheets.

       

      Sometimes, when the workbook loads, the employee list correctly reflects the team of the person logged in.  The other worksheets, however, show the team of a different person than the one logged in.  If the current user clicks on a filter, it correctly applies the filter to the rest of the worksheets, and the data re-loads.  Un-selecting the filter then causes the worksheets to load with the correct values.  It is only this first time load which displays a different person's team.

       

      After doing some investigation, I found that the workbook seems to be caching data from the last time it was loaded, regardless of the parameter being passed.

       

      Does this make sense to anyone?

        • 1. Re: Parameter behaving oddly
          Carl Slifer

          Hi Kevon,

           

          I've not ran into this issue before but how about creating a filter for [User] = [PersonLoggedIn] and making a filter at the data source level for all of your data sources.Then remove the need for a parameter in your custom SQL. Bring in all the data and let tableau filter it. If you make extracts (probably even if you don't) things will be much more performant then custom SQL which has to go to the database for every query you use and pinging the server for each worksheet/datasource at once for 6 things might be part of the issue.

           

          Cheers,

          Carl Slifer

          InterWorks

          • 2. Re: Parameter behaving oddly
            Kevon Houghton

            Thanks for the suggestion, but I'm not sure that will work, or if it will, I'm not sure how to accomplish it with a filter.  The struggle is that this is a sort of dashboard for managers.  The individual worksheets contain data related to their employees, so it's not a 1 to 1 match.

             

            The custom sql is along the lines of: select * from DataSource where EmployeeID in (select EmployeeID from dbo.GetMyTeam(<Parameters.LoggedInUserID>))

             

            dbo.GetMyTeam is a table valued function

             

            Additionally, this is an embedded report on a trusted server, so the <Parameters.LoggedInUserID> is being passed by the server. The user is not technically logging in to Tableau.