8 Replies Latest reply: Mar 28, 2016 12:39 PM by Sunny Talwar RSS

    How to get a conditional sum()?

    Randy Belknap

      I have a table that looks like:

       

      CategoryMyFlagAmt
      Ay20.00
      Ay25.60
      Bn30.32
      Cn70.00
      Cy9.10

       

      I want a measure that computes the sum of the selected records where MyFlag='y'.  E.g. if all five are selected the measure is 20+25.6+9.10.  The expression I am using is Sum({$<MyFlag='y'>}Amt), but it always shows 0 (zero). Any ideas for what I'm doing wrong?  The expression editor doesn't show any syntax errors.

       

      Thanks