Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Accumulated Expressions

Hello,

I have this source table:

Month,Amount, Perecentage

January 10 , 5

February20,4

February 30,6

Marcha 56,2

April 15, 1

And we need to make a simple table calculating a formula like

sum(Amount*Percentage)/sum(Amount) accumulated by month.

The result table should be something like:

Month, AccumulateValue

January 5 --> (10x5/10)

February 5,16 --> (10x5+20x4+30x6)/(10+20+30)

March --> 4 (10x5+20x4+30x6+56x2)/(10+20+30+56)

April--> 3,33(10x5+20x4+30x6+56x2+15x1)/(10+20+30+56+15)

How do I configure the expression?

Notice that in the new table there is no any accumulated colum.

Thank you,

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Attached are two approaches. The first uses above() to manually accumulate. The second links an AsOfMonth to all Months on or before then so that a simple sum() gives the accumulation. I prefer the second approach, as the first can be broken by simply changing the sort order or selecting values for Month.

View solution in original post

2 Replies
johnw
Champion III
Champion III

Attached are two approaches. The first uses above() to manually accumulate. The second links an AsOfMonth to all Months on or before then so that a simple sum() gives the accumulation. I prefer the second approach, as the first can be broken by simply changing the sort order or selecting values for Month.

Anonymous
Not applicable
Author

Ohhh Thank you SO MUCH!.... My real problem was not to find the option "Hidden Column"!!!

Thank you,

Big Smile