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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Rolling sum - easy in principle - but something is wrong - plz help

Hi,

I want to create a rolling sum in a table.

In principle, I think that is quite easy: I sort my table by item_no (that is my key) ascending (in a RESIDENT LOAD) and,

out of three fields, I calculate the sum that I need for that individual record - so far, everything is fine.

=> Then I use the PREVIOUS() function to decide if the item_no in the current record is still the same as in the last record.

If it is, I just add that sum to the one from the last record.

If it is not, I reset my rolling sum and just copy the sum I have for that individual record.

<=> Something must be wrong there, it doesn't work: I do not have to aggregate or something, do I?

Can you help me out here?

Thanks a lot!

Best regards,

DataNibbler

11 Replies
datanibbler
Champion
Champion
Author

Ah,

seems it was a matter of sorting: I did a sort in the script to have all the records with one item_no together, then it seems I must not sort again on the GUI (not on the item_no nor any other field anyway, but only on the >>load_order_original<< ...

datanibbler
Champion
Champion
Author

OK. Now I'm getting there.

Thanks for your help guys!

The trick was to prepare the two sides to this thing - the delivery_plans and the stock_calculation - separately at first and then joining it, a thing I don't yet know how to do in Crystal_reports where I was actually supposed to do this ... but okay, that is not my problem, and the team won't complain if it works.

Thing is, the company wants to abandon QlikView, but since the licenses and such are bought anyway, there's not much to abandon ... they could just switch off the server, but then I'm not at fault for everything that will break down 😉