Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi There
Please help to achieve the below,
I need to load multiple .CSV files on Incremental basis and folder location is same but file name will differ by date suffix and based on the new or updated record in csv files should updated into base qvd (Insert New record, Update existing record). Next time if a new file comes it should be iterated.
Please help to provide the script.
Thanks
Nandhakumar
Hi Chris
Here is my updated code and i'm working on Qlik sense desktop version.
set vRoot = 'LIB://Conn';
FOR Each File in filelist ('$(vRoot)'&'\*contact*.csv')
CurrentFileList:
Load '$(File)' as File //(txt, codepage is 28591, embedded labels, delimiter is ',', txt);
autogenerate 1;
SET Concatenate = concatenate;
next File
if Not ISNULL(QvdCreateTime('LIB://Conn\MyFile.qvd')) then // check if qvd exists
RESULTS:
LOAD *
RESIDENT CurrentFileList;
Concatenate
LOAD *
FROM [LIB://Conn\MyTable.qvd] (qvd)
Where not exists(ContactID);
STORE RESULTS INTO into [LIB://Conn\FileList.qvd] (qvd);
DROP TABLE RESULTS;
DROP TABLE CurrentFileList;
ELSE
STORE CurrentFileList into [LIB://Conn\FileList.qvd] (qvd);
DROP TABLE CurrentFileList;
END IF
Temp:
LOAD *
FROM [LIB://Conn\MyTable.qvd] (qvd);
Still Concatenate is not working. Also attached the sample data file FYR.
Assume attached 3 files will be loaded on daily basis. (i.e.) each file will be loaded on consecutive days.
For initial Load use: contact_eloqua_full_export2018-10-29
Day 2 load: contact_eloqua_full_export2018-10-30 (For Update example: Record no: 1 is updated with FirstName, LastName, Address1)
Day3 load: contact_eloqua_full_export2018-10-31 (Example to Add New Record)
Finally i should have unique record (i.e.) No Duplicate Records. I hope things are clear.
Please help to fix this.
Thanks
Nandhakumar
Hi Dilip
Great!!!
It is now working. Thank you so much. I really appreciate your help.
Thanks
Nandhakumar
No problems
Hi Chris
I've got the result with the help of Dilip & Now things are working.
I really appreciate your help. Thank you so much.
Regards
Nandhakumar