3 Replies Latest reply on Dec 14, 2016 2:05 PM by Shinichiro Murakami

    Table Calculation- sum of distinct count over time

    Philip Perrin

      Hi Tableau friends -

      I'm attempting to get a percent for each period of time (months) as follows:

      - numerator: distinct number of sub-categories ordered in 12 out of the 12 following months (inclusive of current)

      - denominator: distinct number of sub-categories ordered in the current month

       

      I've got the denominator figured out. Based on the sample workbook, the first few months are:
      - Jan 2013: 14

      - Feb 2013: 13

      - Mar 2013: 16

       

      For the numerator, the values I am trying to obtain are:

      - Jan 2013: 12 (there were 12 sub-categories that were ordered in each of the months between Jan 2013 and Dec 2013)

      - Feb 2013: 12 (12 sub-categories ordered in each month Feb 2013 - Jan 2014)

      - Mar 2013: 13 (13 sub-categories ordered in each month Mar 2013 - Feb 2014)

       

      So the desired % per month would look like:

      - Jan 2013: 85.7%

      - Feb 2013: 92.3%

      - Mar 2013: 81.3%

       

      Any tips on how to produce a rolling distinct conditional count?

      Thanks!

      Phil