3 Replies Latest reply on Jun 29, 2018 8:09 AM by Zhouyi Zhang

    Help - Cannot mix aggregate and non-agregate comparisons or results in 'CASE' expressions

    Andy UK

      Hi guys

       

      I've searched for a solution in the forum and online but I haven't been able to find one...

       

      I get the following error message "Cannot mix aggregate and non-agregate comparisons or results in 'CASE' expressions" when i try and use this

       

      CASE [Metric name]

      WHEN "Spend" THEN [Spend]

      WHEN "Sales" THEN [Sales]

      WHEN "CostPerSale" THEN SUM([Spend])/SUM([Sales])

      END

       

      How should this be changed so it can work?

       

      Many thanks for your help

       

      Andy