Forum Discussion

Aartibhilare's avatar
Aartibhilare
Helper III
1 year ago

Sum of Column based on another column in pagnited report

 

Hi Team,

I have grouped the data at the EmployeeNumber level, and I have the transaction code and its value in separate columns.

However, when I try to run the following expression to sum the transaction amounts for records where the transaction type is "NRT":

 
=Sum(IIf(Fields!TxnTypeCode.Value = "NRT", Fields!TxnAmount.Value, 0), "EmployeeNumber"
 

I am encountering an error in the report.

 

 

 

 

below is database

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Aartibhilare 

     

    It looks like there is a small syntax error in your expression.  Here is the corrected expression:

    =Sum(IIf(Fields!TxnTypeCode.Value = "NRT", Fields!TxnAmount.Value, 0), "EmployeeNumber")

    Please check if it solves your problem?

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Hi Anonymous 

    I have tried it and it didnt work. Still facing same issue

  • Hi,

    Not sure what you are trying to do but try this measure

    Measure = calculate(sum(Fields!TxnAmount.Value),Fields!TxnTypeCode.Value="NRT")

    Hope this helps.