6 Replies Latest reply: Feb 27, 2018 2:49 PM by Ryan Metcalf RSS

    sum over distinct dimension

    Ryan Metcalf

      I would like to know the expression for summing over a distinct dimension.

       

      A very simple example of my data looks like this:

      LineDateShiftMinutes
      108/3/20173480
      208/3/20173480

       

      My complete data set has two years of dates and shifts in it across many lines.  When the line is running, minutes is 480, otherwise it is 0.

       

      I want to sum the minutes of a distinct shift.  I have tried SUM(DISTINCT <ShiftNumber+Date> Minutes) but it doesn't work.  I know that COUNT(DISTINCT ShiftNumber+Date) gives me the correct answer of 1.