Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Cumulative calculation from 3rd day

Hi,

We were using the below logic to get the cumulative total.

Logic: rangesum(above(total sum(Product$TY), 0, rowno(Total)))

But we need to calculate the cumulative total from 3rd row.

Thanks..

1 Solution

Accepted Solutions
MayilVahanan

Hi

Instead of RangeSum, try with RangeAvg() function.

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

8 Replies
sujeetsingh
Master III
Master III

So this expression is used in straight table. You can use rank() there and just write a if condition that if rank is 3 then rangesum(above(total sum(Product$TY), 0, rowno(Total)))

nareshthavidishetty
Creator III
Creator III
Author

Hi,

Can you please provide the complete logic,because when i include the rank in the logic it gives error.

Thanks..

MayilVahanan

Hi

Are you looking like this

rangesum(above(total sum(Amount), 0, rowno(Total)-2))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
tamilarasu
Champion
Champion

Hi,

Try this,

Rangesum(Above(total If(Rowno(Total)>2, sum(Product$TY)), 0, Rowno(Total)))

nareshthavidishetty
Creator III
Creator III
Author

Hi,

We need to accumulate the data as below..

31st would remain same..1st would remain same and from 2nd it should accumulate with 1st and so on..

Untitled.png

Thanks..

MayilVahanan

Hi

Try like this

RangeMax(If(Rowno(Total)> 2, rangesum(above(total sum(Amount), 0, rowno(Total)-1)), 0), Sum(Amount))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
nareshthavidishetty
Creator III
Creator III
Author

Thanks Mayil..

The same if we need to do it for %..and we use the below logic..but it simply adds the sum like 1st the % is 10.5% on 2nd its 90.5% but here the cumulative gives 101% which is not correct..we need the avg %

Below is the logic used:

RangeMax(If(Rowno(Total)> 2, rangesum(above(total ((Sum(Product$TY))/Sum(Product$LY)), 0, rowno(Total)-1)), 0), ((Sum(Product$TY))/Sum(Product$LY)))

Thanks...

MayilVahanan

Hi

Instead of RangeSum, try with RangeAvg() function.

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.