Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I have a load script issue and I cannot find the solution in Qlik Load language. In SQL this is super easy, with a subquery or someting, but I can't find the right solution.
Here's my case.
I have a table with costprices. When there is a new costprice, there will be a new line and the enddate will be filled out in the old recordline.
StartDate | EndDate | Item | Price |
---|---|---|---|
01-01-2013 | 31-12-2013 | X0001 | 3.45 |
01-01-2014 | 31-12-2014 | X0001 | 3.55 |
Now I also have a orderline table.
Orderdate | Item | Quantity | Costprice |
---|---|---|---|
01-04-2013 | X0001 | 12 | |
01-02-2014 | X001 | 15 | |
In the orderline table, I want to put the costprice of that time. As said, in SQL I would use a subquery or so and in QV I tried things with intervalmatch, but it didn't work out.How can I get the right costprices?
Thanks in advance!
See attached qvw.
OK, first of all, that works, thank you very much.
Second; I really want to get this .
You are creating a table with orderline info and all the info from the temp table, and after that, you join on startdate, enddate, itemcode, to get the price in. Right?
I struggled with the intervalmatch and the second constraint (item). Thanks, I learned from this.