1 Reply Latest reply on Aug 19, 2015 10:14 AM by Joe Oppelt

    Retained Products IDs in 2 different Dates

    Lloyd Buss

      Hi,

       

      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"

      FROM MyView

      WHERE "Date" in ('01-Jun-2015','18-Aug-2015')

      order by 1;