How to get Col Sum of a row in a conditional statement?Hi all,
I have a column where I need to filter out some values to get the sum of columns (using Col Sum). Is it possible to get the col sum according to the condition? For example, every 0 code will be excluded from the computation:
| Code | Qty | Total Count | Total % (Col Sum (qty)/total count) |
| 0 | 50 | 250 | - |
| 0 | 25 | 250 | - |
| 1 | 60 | 250 | 205/250 x 100 = 82% |
| 6 | 67 | 250 | 205/250 x 100 = 82% |
| 3 | 78 | 250 | 205/250 x 100 = 82% |
I tried using an If statement, but the code with 0 values still gets included when using the Col Sum formula
Automation and ScriptingRe: How to get Col Sum of a row in a conditional statement?You need two if-statements, one to avoid writing values to Code = 0 rows and one to perform the calculation
If(Code != 0,
Col Sum(If(:Code == 0, ., :Qty))
,
.
);
