Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, this is a question about "IntervalMatch".
I have an inventory table which includes inventory qty only within each period, and I want to match dates with the periods so I can have inventory qty for everyday.
The following codes work for only several SKUs. Could anyone help with the codes? Thanks!!
For example,
Inventory Table
SKU FirstDate LastDate QTY
015341755069 2/11/2008 2/27/2008 0
015341755069 2/28/2008 6/4/2009 1
Dates
1/7/2008-6/4/2009
Desired Table
SKU Dates QTY
015341755069 2/11/2008 0
015341755069 2/12/2008 0
015341755069 2/13/2008 0
:
:
015341755069 2/27/2008 0
015341755069 2/28/2008 1
015341755069 2/29/2008 1
:
:
015341755069 6/4/2008 1
This is my code:
Dates.qvd uploaded
Inv.qvd uploaded
You may have to describe the problem in more detail. I downloaded your files, ran the load, and the results look fine to me. You have 0 up through 2/27/2008, then it switches to 1, just like you asked for. I chose another SKU, and while it was MUCH more complicated, the first set of values that I looked at looked correct.
What problem are you seeing? Is there some specific SKU I need to select to see the problem?
My problem was when I limited SKU to only one or two items, the code worked as you saw.
But when I tried to load everything, the execuation of reload failed.
Even if I limit "Date" to only one day, it still failed. I am wondering if it's a problem of memory limit.
But since date is limited to 1 row, inventory is only read 40,000 row or so(if I am not mistaken, I don't have files with me right now),
there shouldn't be a memory problem.
What should we do to solve the problem?
Thank you.
(I'll reload more information when I get data with me)
I ran your sample without the Join and it generated 84M rows. Fit ok in my RAM but when I tried to do the Join I ran out of RAM. I frequently use IntervalMatch for this kind of problem, but I can see it may not a great solution when you have a large number of rows.
Anyone suggest a better way that can handle a large product or rows?
-Rob