2 Replies Latest reply on Jul 9, 2013 5:56 PM by Tracy Rodgers

    Need Help in resolving Error :can not mix aggregate and non aggregate comparisons in IF expression

    Suchi M

      Hi All,

       

      I am new to tableau and i am confused in doing the following.I need the sum of "Record Count" if the Activity Stage is "Accepted" or "Closed Won".I have tried the following in the calculated fields but i am getting "can not mix aggregate and non aggregate comparisons in IF expression".

       

      1)SUM(IIF(StageName='Accepted' AND StageName='Closed Won',RecordCount,0)).For this the calculation is correct,but it get no data on the chart

      2)IF [StageName] ="Accepted" AND [StageName] ="Closed Won" THEN sum(RecordCount) END.For this i get the error "can not mix aggregate and non aggregate comparisons in IF expression".

       

      The following is the excel sheet i have.

       

      Activity StageCountryIntake SemisterRecord Count
      Closed Won BGD2012022
      AcceptedBGD2013029
      AcceptedBHR2012023
      Closed WonBHR2013022
      AcceptedBRA2012028