Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to calculate a value like "= sum(x) / cumulative sum of y"
I can only find cumulative expression based on "above()" function, which doesn't work in this case. I also tried invisible helper column, but this messes up the axes scaling.
What would be the best approach to solve this?
Turns out I had a pretty simple error in my expression that took a while to spot
Instead of RangeSum(Above(sum(x), 0, RowNo()))
I had RangeSum(Above(sum(x)), 0, RowNo())
The results were different of course, and I only spotted it when working on an example for you.
Go through following threads:
It depends on the what data you have & what is the output you need.
Perhaps you need to use Peek & Previous functions to do the cumulative values
see the below links
May be if you can share a sample, someone here can help you get a better answer.
Hi,
Like Kush has mentioned, in a normal case like this i would be looking to add a running total field in my script using the peek and previous functions, but not knowing anything about the data I couldn't say if this would be useful in your case.
So like Sunny has said a sample would be helpful.
Mark
Probably as already said, if you give other informations, it is more simple to help.
Meanwhile I think you can try
Sum(x)/RangeSum(above(Sum(y),0, RowNo()))
Hope it can be useful.
Turns out I had a pretty simple error in my expression that took a while to spot
Instead of RangeSum(Above(sum(x), 0, RowNo()))
I had RangeSum(Above(sum(x)), 0, RowNo())
The results were different of course, and I only spotted it when working on an example for you.