Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Devs,
I have created a pivot table as below.(The first 8 columns)
ID | CAL | A | B | C | D | E | GRAND TOTAL | TP(Positive) | |
100001 | 19-Jan | 500 | -200 | 100 | 200 | -100 | 500 | 500 | |
19-Feb | 0 | -216 | 0 | 0 | 0 | -216 | 0 | ||
19-Mar | 1690 | 0 | -50 | 0 | 0 | 1640 | 1690 |
I want to calculate the TP(positive) column. It is the sum of the positive values in the neighboring columns. But if there is a value like 200 and another like -200, which is directly nullifying the value, I don't need to consider that positive value.
ex: in the first row, there is -200 and 200, -100 and 100, 500. So, here the TP value is 500 as 200 and 100 are not considered.
In the second row there are no positives ,so 0.
And in the third row , there are no negative values for 1690, so the TP is 1690.
(Columns A,B,C,D,E are separate measures calculated based on 'Type' ).Ex:(Sum({<Type={'A'}>}Values))
PFA data file and QVF.
Use an expression of the form:
RangeSum(
RangeMax(0, A),
RangeMax(0, B),
RangeMax(0, C),
RangeMax(0, D),
RangeMax(0, E)
)
If necessary, substitute A with Sum({<Type={'A'}>}Values). etc. You can nest Sum() inside RangeSum(). Alternatively, simply add the RangeMax() terms.
Hi @jonathandienst ,
The above code still returns 800 in the first row. It should return 500.