Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accumulate Field Until the sum of Another field reaches predefined limit

I have a situation in Qlikview that I would like to ask your advice on. We are currently running a number of promotions which we are reporting in Qlikview. For each stock item on promotion there is a threshold value (i.e. the amount available for sale at promotion price).

To add a bit of difficulty the product isn’t always sold at the same price during a promotion. What I need to show is the sum of the sales value for all sales before the promotion threshold was passed e.g:

Stock ID                Qty         Price

1                              1              2.10

1                              1              2.10

1                              2              2.00                       

1                              1              2.10

1                              1              2.10

In the above example the promotion threshold will be 5 (i.e. once 5 are sold I no longer want to include the product in my sum)

Therefore the total revenue for Stock ID 1 will be 10.30. The last sale should not be included as it happened after the threshold was met.

My question is what is the best way to complete this in Qlikview?

Thanks

Andrew

2 Replies
Not applicable
Author

Should I use scripts or is there a way to do this with set analysis and conditions in an expression?

Not applicable
Author

Can anyone help with this