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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis - Cumulative sum with a "less than" filter

Hi there,

I am struggling to get this code right and would appreciate any answers from you. I have looked at the help but not got too far from there. The help does specify the less than for a specific value, but not for a field


sum( {$<Year = {">1978<2004"}>} Sales )


I have to show the opening stock quantity for a specific year. The calculation would be a simple sum of stock quantity which is less than the year that the user clicks on a filter. Of course, in my set analysis, I need to break out of my filter but that causes me a couple of issues of which I will specify on another post.



=sum({1<[Period Year]={"<$(#[Period Year])"}>}[Stock Quantity]*isStock)


I just don;t know what to place after =sum({1<[Period Year] ???

Thanks for your help in advance.

Mike

1 Solution

Accepted Solutions
Not applicable
Author

OK, after some more playing, it seems that the answer was myself not pplacing an = sign before the [Period Year]


Sum({$<[Period Year]={"<$(=[Period Year])"}>} [Stock Quantity])


Hope this help someone else!



View solution in original post

2 Replies
Not applicable
Author

Hi Mike,

see the attached example.

Good luck!

Rainer

Not applicable
Author

OK, after some more playing, it seems that the answer was myself not pplacing an = sign before the [Period Year]


Sum({$<[Period Year]={"<$(=[Period Year])"}>} [Stock Quantity])


Hope this help someone else!