Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi team,
In daily basis this qvd's are generated.
The scenario i am facing is how bring all these qvd's into single block in script.( using For loop)
And how to identity only Mondays present in the qvd's and load them in script.
Please give your suggestions
Regards
Ashok ravichandran
Hereis the solution.
Data:
LOAD ID,
DATE,
SALES,
FileName() as FileName
FROM
(qvd)
WHERE WEEKDAY(DATE(DATE#(MID(FileName(),10,8),'DDMMYYYY'))) ='Mon';
Hey,
For the Load Script it is pretty easy once you know how to do it. You can pretty much do Load * From PATH/ABCD_fact*.qvd and this will load all your qvds in. If you want only Mondays, you can make a date variable like:
let a = 0;
let vDate = Date(Today() - a, 'MMDDYYYY');
a will be the counter for your loop and for your days.
Lets say you only want the last 60 days of Mondays:
let a = 0;
let vDate = Date(Today() - a, 'MMDDYYYY');
Do while (a < 60)
if(num(weekday(vDate) = 0) then
Load * From PATH/ABCD_fact$(vDate).qvd;
end if
let a = a + 1;
let vDate = Date(Today() - a, 'MMDDYYYY');
Loop
Now this is just an example so you will probably have to adjust some things (e.g. PATH should be changed to the correct path).
Let me know how that goes.
Also if you experience an error that stops the loop, just put the following statement above the do while line:
let ErrorMode = 0;
It will still look like there is an error, but that just means there is no file associated with that name and it will skip it.
Hi,
TMP:
LOAD *,
DATE(date#(KeepChar(FileName(),'0123456789'),'MMDDYYYY'),'MM/DD/YYYY') as dateFile
FROM [..\H\qvdFolder\*.qvd] (qvd);
SUM:
LOAD *, WeekDay(dateFile) AS DayNam Resident TMP
Where NUM(WeekDay(dateFile))=0
;
DROP Table TMP;
**********
Hereis the solution.
Data:
LOAD ID,
DATE,
SALES,
FileName() as FileName
FROM
(qvd)
WHERE WEEKDAY(DATE(DATE#(MID(FileName(),10,8),'DDMMYYYY'))) ='Mon';
Liam,
Thanks for your suggestion, let me work it out and get back to you!!
Arjun Bro,
Once again thanks for your suggestion,Let me work it out and get back to you!!
Please check and mark the Correct Answer and close the tread. Thank you.
It Worked thanks Arjun