MAunAli
MAunAli

Reputation: 13

GL Ranges with Sum Amount in SSRS Expression

Please help me out as I'm getting 0 in the amount field when I use the following expression in a textbox on one of my ssrs report.

=IIF(Fields!GLNUM.Value >= "KMBGL.2325" AND Fields!GLNUM.Value <= "KMBGL.2875",SUM(Fields!AMOUNT.Value),0)

Upvotes: 0

Views: 25

Answers (1)

Alan Schofield
Alan Schofield

Reputation: 21683

As you have not supplied any sample data this may not work but the first thing to say is that you expression is probably incorrect.

Think about it this way. .. For each row, determine if you need to include the AMOUNT field or return zero .. Sum these results

You done it the wrong way round (common mistake)

Try it this way

=SUM(
    IIF(Fields!GLNUM.Value >= "KMBGL.2325" AND Fields!GLNUM.Value <= "KMBGL.2875"
    ,Fields!AMOUNT.Value
    ,0)
)

Upvotes: 1

Related Questions