Discussion Board for collaboration on QlikView Scripting.
I have two tables stored into qvd:
What I want is to create a table with the Article, the Purchase Date and the Price (the price is retrieve depending of the validty period):
So I need to do a join between article.qvd and price.qvd
on Article.Article = Price.Article
and Article.Purchase_Date between Price.Start_Date and Price.End_Date.
I know how to do this in SQL but not with QVD file.
Can someone help me?
You can use interval match..
Go through this link..
try using the intervamatch on Purchase_date like this:
LOAD * INLINE [
Article, Price, Start_Date, End_Date
A1, 5, 01/01/2012, 31/12/2102
A1, 7, 01/01/2013, 31/12/2013
A2, 10, 01/01/2012, 30/06/2012
A2, 8, 01/07/2012, 31/12/2103
A3, 2, 01/01/2013, 31/12/2013
A4, 12, 01/01/2013, 15/02/2103
A4, 13, 16/02/2013, 28/02/2103
A4, 15, 01/03/2103, 15/03/2013
Left Join (Article)
Thank you for your quick answer.
But the result of the intervalMatch is not what I expect.
How can I suppress unnecessary rows?
in the Table Box you can supress the NULL values in the presentation tab.
I know but in fact I don't want to use a table. I need to stored into a table only the row with the good price for the purchase date.
With the intervalmatch, it seems that we have a Cartesian Product.
And for Example, for the Article A4, I don't have the good result, even if I suppress the Row if the field is Null.
I think that my problem is due to the join on the key Article but i don't find a solution.
Do you know how to solve this problem?
I find this solution:
Article, Price, SD, ED
A4, 12, 01/01/2013, 15/02/2013
A4, 13, 16/02/2013, 28/02/2013
A4, 15, 01/03/2013, 15/03/2013
Load Article, Price, PD
where PD >= SD
and PD <= ED;
drop table Article;
Thanks everybody for the help!