Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm working on areq. where there were 20-30 Qvd files with same name but diff. time stamp.
YYYYMMDDFIlename.Qvd
Need to select the latest Qvd for the reload.
Can anyone pls help me in loading the latest qvd dynamically.
Hi Sunny,
Can i know why is it mentioned Resident Table in Date:
When we r nt fetching anything from table.
My bad:
Date:
LOAD Num(Today() - x) as Date //where x needs to be an integer
AutoGenerate 1;
LET vMaxDate = Date(Peek('MaxDate'), 'YYYYMMDD');
DROP Tables Table, MaxDate;
FinalTable:
LOAD *
FROM $(vMaxDate)ABCDEN00.qvd (qvd);
Is this right?
Table:
First 1
LOAD FileName() as File,
Date#(Left(FileName(), 8), 'YYYYMMDD') as Date
FROM *ABCDEN00.qvd (qvd);
MaxDate:
LOAD Max(Date) as MaxDate
Resident Table;
Date:
LOAD Num(Today() - x) as Date //where x needs to be an integer
Resident Table;
LET vMaxDate = Date(Peek('MaxDate'), 'YYYYMMDD');
DROP Tables Table, MaxDate;
FinalTable:
LOAD *
FROM $(vMaxDate)ABCDEN00.qvd (qvd);
No just use this:
Replace x with the number of days back you will have your most recent qvd to be. If its today's qvd then x = 0, yesterdays x = 1 and so on...
Date:
LOAD Num(Today() - x) as Date //where x needs to be an integer
AutoGenerate 1;
LET vMaxDate = Date(Peek('MaxDate'), 'YYYYMMDD');
DROP Tables Table, MaxDate;
FinalTable:
LOAD *
FROM $(vMaxDate)ABCDEN00.qvd (qvd);
So, in this case, we donot need to load the "Table" at first where we r using Drop Tables Table, Date;
Yup, you are right, no need to drop Table Just use Drop Table Date;
Making too many silly mistakes today
Can you paste a screenshot of your script, where you are doing this:
Date:
LOAD Num(Today() - x) as Date
AutoGenerate 1;
LET vMaxDate = Date(Peek('MaxDate'), 'YYYYMMDD');
Sunny, its working
Small editing...
Its LET vMaxDate = Date(Peek('Date'), 'YYYYMMDD');
we were using LET vMaxDate = Date(Peek('MaxDate'), 'YYYYMMDD');
where der is no 'MaxDate'.. we have only 'Date'