I am executing a New Custom SQL with CASE-choice fields in Tableau:
SELECT x1, x2, x3 ...,
CASE WHEN x1>1 THEN 'y'
ELSE '' END AS x_new
...
FROM table1a
FULL JOIN table2a...
WHERE x3>4
UNION ALL
SELECT x1, x2, x3 ...,
CASE WHEN x1>1 THEN 'y'
ELSE '' END AS x_new
...
FROM table1b
FULL JOIN table2b
WHERE x3>4 ...
It's a live connection with database. I tried to work with an extract too. The problem here is that CASE-generated fields are not possible to work with in the worksheet. The standard fields (right after SELECT-statement) behave fine, no issue with them.
I know I may just query and then create a group of calculated fields. It's ok. However, maybe someone can explain why fields created via CASE-statement in the custom SQL are unusable. I am trying to understand if it's an error on my side or it's Tableau limitations.