'Querying Column Name as Variable Using Tableau Custom SQL
I am building a lookup tool that will take Column Name and Table Name as inputs from Tableau as Parameters, and plug those in to Tableau Custom SQL as Parameter values, but I cannot find a way to make the Column Name dynamic in the select query.
Here is the idea:
Select ParameterColumnName
FROM TABLE(ParameterTableName)
I have investigated Snowflake's "IDENTIFIER" commands, but those seem to work only in the FROM clause of the query. I have tested with a static column name and dynamic table name and that works fine. I have also explored setting variables with the parameter column name values, but I cannot seem to use "SET" in Tableau Custom SQL--it does not recognize SET. Appreciate any pointers.
Update: This post appears to address why I cannot set variables from Custom SQL, but if that's not it, let me know!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
