Page 1 of 1

Sum - Multiples Conditions

Posted: Sat Jan 23, 2021 4:45 pm
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.

Re: Sum - Multiples Conditions

Posted: Mon Jan 25, 2021 9:40 pm
by Lech Kulikowski
Hello,

You can use the SumIf() function.

Thank you.

Re: Sum - Multiples Conditions

Posted: Mon Jan 25, 2021 10:19 pm
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.

Re: Sum - Multiples Conditions

Posted: Tue Jan 26, 2021 10:49 am
by Lech Kulikowski
Hello,

Thank you for the information.