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: 
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
Luminary Alumni
Luminary Alumni

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
Luminary Alumni
Luminary Alumni

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