Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Between / subquery /intervalmatch(?) issue

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.

StartDateEndDateItemPrice
01-01-201331-12-2013X00013.45
01-01-201431-12-2014X00013.55

Now I also have a orderline table.

OrderdateItemQuantityCostprice
01-04-2013X000112
01-02-2014X00115

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!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

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.