If that's not possible. Can I display data in a dashboard based on the tableau server logged in user ? i.e. if the user logged in server is jsmith then the dashboard will display results bases on the query: select * from employees where userName = 'jsmith'
Is that possible ?
Yes, there is a feature called "user filters" for this purpose, with a calculated field function called USERNAME().
James -- I've got a related question, a more generic version of the same question Khaled poses. Can Tableau dynamically modify the content of a data connection? For example, if I had a data connection that contained a table valued function call like this:
Select * from [dbo].[MY_TABLE_VALUED_FUNCTION_VW](12345,'WENDY','2010/08/01 00:00:00','2010/08/30 11:59:59')
Could I modify the parameters dynamically from dashboard selections? Or, do I only have the ability for Tableau to generate the WHERE clause on the table?
No, if a data connection is set up via Custom SQL, you cannot pass dynamically pass parameters to that connection SQL.
is it possible to pass paramters to the data_connection? e.g my requirement is to filter out the data based on some fields like user_id, region_id etc.. How can i build the dynamic sql to filter data dynamically based on user_id?
I was reading this post as I am looking to do something similar.I know it is quite old, but i thought i d still reply for other people who would read this.
It looks like you could do it now. Go to connect data -->custom SQL. Create a parameter based on the Username field and then use the parameter in your query:
Select * from employees where Username = <Parameters.username>.
It doesn't seem to work in the FROM part of your SQL as the parameter is a string, therefore it adds ' ' before and after the value which doesn't match the table name anymore.