0
votes

I currently try to solve the following issue in Tableau: In the end, I would like to have a Tableau dashboard where the user can select a Customer, and then can see the Customer's KPIs. Nothing spectacular so far.

To obtain a Customer's KPIs, there is a CustomSQL query with a parameter "CustomerName" (that returns the KPIs for that Customer).

Now the thing: I don't want to have a hardcoded list of CustomerNames, as it would be possible with Tableau Parameters. Instead, the CustomerNames should be fetched from another datasource. I did not find a way to "link" a Parameter to a DataSource, and/or inject something other than static Parameters into CustomSQL. My Question: Is there really no solution for this, or am I just doing something wrong (I hope so).

I found this workaround here https://www.interworks.com/de/blog/daustin/2015/12/17/dynamic-parameters-tableau that seems to work, but that looks like... a workaround.

Few background info: I have to stick to using a CustomSQL because

  • It is not viable for me to calculate all KPIs for all CustomerNames and then filter by Tableau, since the data amount is too big.
  • It is not viable to replace the CustomSQL with Tableau Calculations and Filters (already tried that, ended up in having Tableau pulling too much data instead of pushing the work to the database).

I cannot believe that Tableau does not offer a solution here, since the use case is pretty common I believe.

Do you have some input for me?

Thank you for your help in advance!

Kind Regards

1
Did you mean "Tableau calculations" or "table calculations" in your second bullet? Table calculations could indeed pull too much data to the client, but LOD calculations are implemented server side. I'd give them a try. You could also read about raw SQL functions, but they don't fit every case - Alex Blakemore

1 Answers

0
votes

have you tried using rawsql() functions together with stored functions on the database side? I found it pretty useful when needed to load single value from the dataset completely not related to currently used datasource. For example, running foo stored function which accepts 2 dates and calculated sum of something, Syntax should be something like:

rawsql_int(your_db_schema.foo(%1,%2),[startDateFieldTableau],[endDateFieldTableau])

but you can access it directly:

rawsql_int("select sum(bar) from sales")

but this is bit risky.

Drawbacks:

  • it relies on the current connection (you create a calculated field (duh!)
  • it will not work with extract (but you are using custom sql anyways so I believe you are more into live connection