11 Replies Latest reply on Sep 9, 2016 9:41 AM by David Li

    Error in calculation field??

    Sandeep Kotha

      Hi All,

       

      I have a field called [B/A] = After,Before,No. I have created a field called score as:

       

      1.Score:

      (count([Field1])/(Count([Field1])+Count([Field2])+Count([Field3])))-(count([Field3])/(Count([Field1])+Count([Field2])+Count([Field3])))

       

      I got the correct answer.

       

      I am creating one field as below:

       

      2. BScore :

       

      If [B/A]='Before' then

      (count([Field1])/(Count([Field1])+Count([Field2])+Count([Field3])))-(count([Field3])/(Count([Field1])+Count([Field2])+Count([Field3])))

      END

       

      the above 2nd point gives the error as :

      "Cannot mix aggregate and Non aggregate comparisons or results in  'IF' expressions"

       

      So, I have used fixed option as below

      if [B/A]='Before' then

      {fixed [Ooid] :((count([Field1])/(Count([Field1])+Count([Field2])+Count([Field3])))-(count([Field3])/(Count([Field1])+Count([Field2])+Count([Field3]))))}

      END

       

      But it is giving wrong value when I use the fixed option.

       

      Can someone help me with the correct code for the second point?

       

      Best wishes,

      Sandeep