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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculation of Date & quantity in diff rows (availability)

Here's a tough case:

How do you calculate the stock available after a sale by using two tables - one for the
sales and another for the deliveries?
I ran into the following problem: as I join the two tables of the sales and the

deliveries together, for each sale I have to get the delivered quantity for the period before the sale (Date>SupplyDate) and calculate the remaining quantity. I can't figure out how to make this work. Any ideas?

For example look at the file attached...

4 Replies
stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi Konstantin,

Is the date of Sale/Delivery relevant? Is availability not All Deliveries - All Sales?

Stephen

Not applicable
Author

Hi, Stephen.

The date of Sale/Delivery is not relevant. They happen at random. In principle, yes,
availability is All Deliveries - All Sales, but what I need is By Product.

I've got to know how much is the remaining quantity of each product at the point of sale. Confused

stephencredmond
Partner - Specialist II
Partner - Specialist II

You could use an Aggr to get the delivery values:

Aggr(NODISTINCT Sum(DeliveryQTY),Product)



Stephen

Not applicable
Author

Hi,

i believe the best is to change the load script.

Check the attached QVW.

Regards,

Joao