5 Replies Latest reply on Sep 28, 2018 6:45 AM by Ryan Hawkins

    Cannot mix aggregate and non-aggregate comparisons or results in IF expressions

    Ryan Hawkins

      Hi guys,

       

      I am having issues with the below formula. I keep getting the "Cannot mix aggregate and non-aggregate comparisons or results in IF expressions" error

       

      IF [Dates Selected]="Last Year" THEN [Total Transactions]

      ELSE 0

      END

       

       

      [Total Transactions] is a calculated field = [Transactions Gross]+[Hotel - Transactions]

       

      where

       

      [Transactions Gross] = IFNULL(COUNTD([Document Number]),0)

      [Hotel - Transactions] = IFNULL(SUM([BookingStatusID]),0)

       

      Is there anyway i can get the calculation to work?

       

      Many Thanks!