13 Replies Latest reply on Sep 21, 2018 6:58 PM by NAYANA MADHEKAR

    Cannot Mix Aggregate and Non Aggregate Functions

    NAYANA MADHEKAR

      Hello,

       

      I have Sales Value which is calculated as [Sales] = SUM(Net units)/ SUM(Activations).

       

       

      I need to have a a condition to show Previous Week , Month & Quarter on the same dashboard. Therefore, Im using calculated fields, as follows for previous month:

       

      IF DATEDIFF('month',[Date],TODAY())=0

      and

      [Date]<=TODAY()

      then

      [Sales]  ------ (Here lies the error)

      END

       

      But it is giving me an error saying cannot mix agg & non agg functions. How can I improve my query?

      Any help is appreciated. Thank you.