Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need
Product | VERSION | Tot_Cost | Cumulative_Sum |
---|---|---|---|
A | 0 | 100 | 100 |
A | 1 | 200 | 300 |
A | 0 | 0 | 300 |
B | 2 | 300 | 300 |
B | 0 | 50 | 350 |
Cumulative Sum is calculated as:
RangeSum(Above(Total Aggr(Sum(Tot_Cost), Product, (VERSION, Tot_Cost)), 0, RowNo(Total)))
Tot_Cost here is calculated as:
RangeSum(sum({$<VERSION={0}>} Field 1), sum({$<VERSION={0}>} Field 2)),
Here I noticed when the value of a field is - then applying sum is the value changes to 0..why does that happen?
But I get the result as
Product | VERSION | Tot_Cost | Cumulative_Sum |
---|---|---|---|
A | 0 | 100 | 100 |
A | 1 | 200 | 300 |
A | 0 | 0 | - |
B | 2 | 300 | 300 |
B | 0 | 50 | 350 |
Why is this happening is it because all the null values in Tot_cost are converted to 0 since it is a measure?Has anyone faced the same issue if so please help me in understanding why this happens.
Hi @Keerthi1234 ,
Try this : add a Alt() function around the fields to give you an alternative value to NULL value. So the new expression for Tot_Cost becomes :
RangeSum(sum({$<VERSION={0}>} Alt(Field 1,0)), sum({$<VERSION={0}>} Alt(Field 2,0)))
Regards.