I have an table (extract) containg a daily snapshot of products. I have provided 2 parameters to filter different dates and the requirement is to work out what product ID's exist in both dates. Now I know I can write some custom sql to join the table back on itself and pass the parameters down to the SQL but I want to be able to do this within my standard daily extract. Is this possible? I thought about creating combining 2 sets based on dates but it didnt give me the option to combine them. My colleage wrote this SQL below which if I could filter on the 2 from the Rank1 will give me a list of products in both dates. Now is it possible to use table calculations in Tableau to do this?
Select PRODUCT_ID, "Date", DENSE_RANK() OVER(PARTITION BY PRODUCT_ID ORDER BY "Date") As "Rank1"
WHERE "Date" in ('01-Jun-2015','18-Aug-2015')
order by 1;
Calc field can look something like this:
If [Date]=[Parameter1] or [Date]=[Parameter2] then 1 else 0 end
Put that on the filter shelf and select for value=1. You''ll get all rows where the date is either parameter value.