2 Replies Latest reply on Feb 3, 2016 9:19 AM by Mahadev Somashekhar

    Cant mix aggregate and non-aggregate comparisons or results

    Mahadev Somashekhar


      Can you please help me with the below error


      "Cant mix aggregate and non-aggregate comparisons or results"


      I created a formula with the below script

      IF CONTAINS([Select Measure],'Discount') then [Discount] elseIF CONTAINS([Select Measure],'Profit') then [Profit] elseIF CONTAINS([Select Measure],'Quantity') then [Quantity] elseIF CONTAINS([Select Measure],'Sales') then [Sales] elseIF CONTAINS([Select Measure],'Profit Ratio') then [Profit Ratio] else 0 END



      The highlighted text causes a problem because [Profit Ratio] is not directly been fetched from the data source but a calculated measure


      Formula for  [Profit Ratio] is SUM([Profit])/SUM([Sales])



      I am using the Tableau Sample Data Source - EU Superstore.

      Thanks for all the help in advance.