Sum - Multiples Conditions

Stimulsoft Reports.NET discussion
Post Reply
brjohnsmith
Posts: 35
Joined: Mon Jan 29, 2018 11:04 am

Sum - Multiples Conditions

Post by brjohnsmith »

Hi,
I need an expression where it is possible to sum multiples conditions. Ex: suppose that I have on level1 (A, B, C), on leven2 (X, Y, Z), and on level3 (OK, NOK, NA). for all levels, we have multiples combinations. now, I need to get the total for the combinations - it means, as I dont know which option each level would be choosen, I need to have the total for all combinaations, how can I do?

1) Sum=if A and X and OK
2) Sum=if A and X and NOK
3) Sum=if A and X and NA
4) Sum=if A and Y and OK
5) Sum=if A and Y and NOK
6) Sum=if A and Y and NA
7)....

and so on.
note: I would like to solve it using the expression, not by code (programmer).
thank you.
Lech Kulikowski
Posts: 7341
Joined: Tue Mar 20, 2018 5:34 am

Re: Sum - Multiples Conditions

Post by Lech Kulikowski »

Hello,

You can use the SumIf() function.

Thank you.
brjohnsmith
Posts: 35
Joined: Mon Jan 29, 2018 11:04 am

Re: Sum - Multiples Conditions

Post by brjohnsmith »

Hi,
I tried other function - CountIf, and it seems that it had the same result, such as: {CountIf(fieldA=="A" && fieldB=="X" && fieldC=="OK")} I can also add || at the same expression && (AND) and || (OR). It seems that it worked, but if someone knows that it will bring me a wrong result, let me know. thx.
Lech Kulikowski
Posts: 7341
Joined: Tue Mar 20, 2018 5:34 am

Re: Sum - Multiples Conditions

Post by Lech Kulikowski »

Hello,

Thank you for the information.
Post Reply