Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Team,
Here i am facing an issue with monthend sales qvd's.
Every month end am storing sales in (30-4-2019-sales) QVD and calling with *-sales. It will call all the sales with existing months. But now suddenly new fields added in 5th month. now QVD name is 30-5-2019-sales.
FROM [...QVDLOAD\MonthEnd\*-sales UAE.qvd]
Now i want take the data along with the new fields. how can merge this fields data.
Is there any way to put prefix FROM [$(QVDLOAD)MonthEnd\ >=30-5-2019Sales UAE.qvd] ???
Thanks in advance.
I am not sure whether you want to dynamically add new fields or filter to load only May 2019, and later - but assuming a bit of both:
Result:
LOAD 0 as FileDate AutoGenerate 0;
For Each vFile in FileList('..QVDLOAD\MonthEnd\*-sales UAE.qvd')
Let vFileDate = Num(Date#(TextBetween(vFile, 'MonthEnd\', '-sales UAE.qvd'), 'd-M-yyyy'));
If vFileDate >= MakeDate(2019, 5, 30) Then
Concatenate(Result)
LOAD *,
Date($(vFileDate)) as FileDate
FROM [$(vFile)] (qvd);
End If
Next
This is typical and good in real time scenario. Please let me know if any one not understand the query.
Thanks for your response Bing, I understood but
What is this QvdLoadDate? First of all in load script it will not take, will through error. Can you please give me a clarity on this?
I am not sure whether you want to dynamically add new fields or filter to load only May 2019, and later - but assuming a bit of both:
Result:
LOAD 0 as FileDate AutoGenerate 0;
For Each vFile in FileList('..QVDLOAD\MonthEnd\*-sales UAE.qvd')
Let vFileDate = Num(Date#(TextBetween(vFile, 'MonthEnd\', '-sales UAE.qvd'), 'd-M-yyyy'));
If vFileDate >= MakeDate(2019, 5, 30) Then
Concatenate(Result)
LOAD *,
Date($(vFileDate)) as FileDate
FROM [$(vFile)] (qvd);
End If
Next
Hi Jontydkpi,
Thanks for your response. Yes I need dynamically. If any changes happen in new QVD, it should take automatically from existing QVD also.
I will try with script which you have provided.
Thanks for guidance.