I have a very simple SQL union in my workbook that allows me to compare current to previous values in a time series data set, courtesy Joe Mako.
The query is:
SELECT *, "current" as [data]
SELECT *, "previous" as [data]
pretty straightforward. I would expect all the dimensions in my first extract to be available in my second extract, which is a duplicate of the first + the custom sql. However, over the course of working with the two extracts, the one created from the custom sql has fields that are grayed out, like St (short for state), which is available in the first extract but not the copy. Then there are fields in the first extract that aren't even in the 2nd one.
I suspect the red bar running down the left side of the dimensions and measures (see image below) is trying to tell me something, but I can't find reference to it in documentation.
I tried to replicate this problem using the sample Tableau data, but all the fields showed up in the duplicate extract created from the same type of custom sql. Unfortunatley, the data I'm dealing with are confidential, and I can't post the file to this board. But the image of the dimensions is below.
Any ideas on how I can get my fields back? I've recreated the extract from the custom sql, but that didn't work.
Here's an image of the dimensions and measures for the 2nd extract.
I was able to resolve the problem by using the specific variable names in the select statement, rather than select *. Not sure why that worked, but it did.