Qlikview Notes

IF Alt(FileSize(vQVDPath & '\'& 'TBL_EMP.qvd'), 0) = 0 THEN
 TBL_EMP:
 LOAD *,
 Date(Floor(Date#(DATE, 'DD/MM/YYYY hh:mm'))) AS DATE_FORMAT,
 FileName() AS Source_FileName
 FROM
 [$(vFilePath)\*TBL_EMP.csv]
 (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

Concatenate(TBL_EMP)
 LOAD *,
 Date(Floor(Date#(DATE, 'YYYY-MM-DD hh:mm:ss TT'))) AS DATE_FORMAT, //2015-12-21 09:00:00 AM
 FileName() AS Source_FileName
 FROM
 [$(vFilePath)\*TBL_EMP.dat]
 (txt, codepage is 1252, embedded labels, delimiter is '|', msq, header is 1 lines);
 ELSE
 TBL_EMP:
 LOAD
 *
 FROM $(vQVDPath)\TBL_EMP.qvd (qvd)
 WHERE DATE_FORMAT < MonthStart(Today());

IF Alt(FileSize('$(vFilePath)' & '\*$(vCurrentMonth)*TBL_EMP.dat'), 0) > 0 THEN
 Concatenate(TBL_EMP)
 LOAD
 *,
 Date(Floor(Date#(DATE, 'YYYY-MM-DD hh:mm:ss TT'))) AS DATE_FORMAT,
 FileName() AS Source_FileName
 FROM
 [$(vFilePath)\*$(vCurrentMonth)*TBL_EMP.dat] //D.2015-12-21_TBL_EMP
 (txt, codepage is 1252, embedded labels, delimiter is '|', msq, header is 1 lines);
 ENDIF

IF Alt(FileSize('$(vFilePath)' & '\*$(vCurrentMonth)*TBL_EMP.csv'), 0) > 0 THEN
 Concatenate(TBL_EMP)
 LOAD *,
 Date(Floor(Date#(DATE, 'DD/MM/YYYY hh:mm'))) AS DATE_FORMAT,
 FileName() AS Source_FileName
 FROM
 [$(vFilePath)\*$(vCurrentMonth)*TBL_EMP.csv]
 (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
 ENDIF

ENDIF

STORE TBL_EMP INTO $(vQVDPath)\TBL_EMP.qvd;
 DROP TABLE TBL_EMP;
 //Exit Script;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s