Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There,
I have created the script below to create a QVD from daily extracts and the do Incremental load from the new data. When I run the script nothing happens. Is there something that I am doing wrong? See script below, attached file with the naming convension and advise?
SavedLastFile = $(LastFile);
StartPeriod = 20131231235959;
sub DoDir (Root)
Set Delim = '_';
for each Ext in '.csv'
for each File in filelist (Root & '\OnlineTillDailyReport*' & Ext)
Set FilePathName = $(File);
//FileDateTime = num(replace(replace(subfield(FilePathName, Delim, 2),'_',''),Ext,''));
FileDateTime = num(replace(replace(replace(subfield(FilePathName, Delim, 2),'_',''),' ',''),Ext,''));
if FileDateTime > LastFile and FileDateTime > StartPeriod then
OnlineTill:
LOAD //Date(Date#(Shift_Date,'m/d/yyyy h:mm'),'m/d/yyyy') as Date,
Date(Shift_Date,'YYYY-MM-DD') as Date_OTILL,
User_Details,
Shift_ID,
//User_Home_Depot,
LEFT(User_Home_Depot,8) & '_' & Date(Shift_Date,'YYYY-MM-DD') as OTILL_JOINKEY,
BD_Number,
Transaction_Count,
Credit_Card,
Cash,
Cheque,
Total_Amount
FROM
[$(File)]
(txt, utf8, embedded labels, delimiter is ',', msq);
LastFile = FileDateTime;
end if
next File
next Ext
//for each Dir in dirlist (Root&'\*')
//call DoDir (Dir)
//next Dir
end sub
call DoDir ('\\03rnb-qlkvw01\QVData\Kiosk\OnlineTill')
//Append OnlineTill_Master on to NewData
if $(SavedLastFile) > 0 and LastFile > SavedLastFile then
OnlineTill:
LOAD //Date(Date#(Shift_Date,'m/d/yyyy h:mm'),'m/d/yyyy') as Date,
Date(Shift_Date,'YYYY-MM-DD') as Date_OTILL,
User_Details,
Shift_ID,
//User_Home_Depot,
LEFT(User_Home_Depot,8) & '_' & Date(Shift_Date,'YYYY-MM-DD') as OTILL_JOINKEY,
BD_Number,
Transaction_Count,
Credit_Card,
Cash,
Cheque,
Total_Amount
FROM
[\\03rnb-qlkvw01\D\QVData\Elija's_QVD's\OnlineTill_Master.qvd] (qvd);
end if
if LastFile > SavedLastFile then
Store OnlineTill into [\\03rnb-qlkvw01\D\QVData\Elija's_QVD's\OnlineTill_Master.qvd];
Drop Table OnlineTill;
end if
Hi Elijah,
Please find link,
Script for Incremental Loading of Multiple QVDs from a List of Table Names
Hope it will make help you to solve your problem.
- Regards,
Vishal Waghole