2 Replies Latest reply on Jan 20, 2016 6:43 AM by Ben Page

    Getting cannot mix aggregate and non aggregate measures error

    Rinki Kaistha

      Hi,

       

      I have sample data in below format:

        

      DateSales
      13-Dec-164065
      13-Dec-163051
      13-Dec-164962
      13-Dec-162199
      13-Jan-163781
      13-Jan-163376
      13-Jan-163383
      15-Jan-154478
      15-Jan-152374
      15-Jan-152989
      15-Jan-152109
      15-Jan-153500
      18-Apr-153783
      18-Apr-152797
      18-Apr-153855
      18-Apr-153535
      18-Apr-152059
      18-Apr-152618
      18-Apr-153759

       

      Expected Output:I want to find the sum of sales for Max Year.

       

       

      Trying to use below query:

      if year([Date]) = max([Date]) then [Sales]

      else 0

      END

       

      This formula is giving aggregate/ non aggregate error. I tried using attribute as well but it is not giving correct values.

      Please suggest.