17 Replies Latest reply on Jul 2, 2018 7:24 PM by Dave Attrill

    cannot mix aggregate and non-aggregate calculation

    Dave Attrill

      Hello everyone, I am fairly new to Tableau and trying to work through a few issues I am coming up against.  I have managed to get one of my calculations to work by conditioning the aggregate but the calculation I am having issues with now has two SUMs in it and I think that's where I am running into problems now.  If I try to condition the aggregate by wrapping it in a sum I don't get proper results so I must be missing something.  Is there some other way to format the calculation below?

       

       

       

      IF ([Post Date] >= [StartDate]) AND ([Post Date] <= [EndDate]) THEN
        (sum(([Price1]-[Cost Ns])*[Qty Ship]))/(sum([EXT]))
      ELSE
          0
      END