7 Replies Latest reply: Sep 15, 2016 1:19 PM by Fernando Vizcaino RSS

    Sum function within an if condition

    Apoorva SD

      Hi all,

       

      I have a field called "Account_Number" and two other fields say "A" and "B". Now the requirement is, I need to calculate amount for the Account numbers. Condition for this is, when the Account_Number= 4300910 , 4300920, 9000405 then, it should check if first four digits of A and B are not equal, if so then only calculate the amount for these account numbers. Whenever first four digits of A and B are equal, we have to ignore that amount. For rest of the Account_Numbers, amount should be calculated without applying the condition for A and

       

      ABAB
      Account_Number5007100500810050071005007200Report
      4101100 (other Account_Number)5005001000
      4300910500500500

       

      I tried the below expression, but not able to get it work.

       

      =if(match(Accounts_Number,'4300910' ,'4300920','9000405'),if(left(A,4)<>left(B,4),sum(Amount)),sum(Amount))

       

      Note: "Amount" is again an expression provided at the script side (an "if" condition)

       

      Any help on this?

       

      Thank you.