2 Replies Latest reply on Mar 16, 2016 12:11 AM by Shivang Desai

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

    Shivang Desai

      Hi All,

       

      I am trying to add a condition and based on that calculate average. But I am getting "Cannot mix aggregate and non-aggregate comparisons or results in IF expression" error.

       

      Even after solving that error using ATTR function, the value is not displayed.

       

      Example:

       

      The following screenshot was working:

      Screenshot (3).png

       

       

      Screenshot (17).png

       

       

      So the above works properly.

       

      Now I tried to add a condition like:

       

      IF [Membership Status] = "Registered Member" and [Verification Status] = "Verified"

      THEN (SUM([Reg Member Sales])/SUM([Reg Member Transactions]))

      END

       

      I get an error "Cannot mix aggregate and non-aggregate comparisons or results in IF expression"

       

      So I solved it with the following:

       

      IF ATTR([Membership Status]) = "Registered Member" and ATTR([Verification Status]) = "Verified"

      THEN (SUM([Reg Member Sales])/SUM([Reg Member Transactions]))

      END

       

      The calculation is valid now but I don't see the value in the dashboard.

       

       

      Can anyone please help me with this?

       

      Regards