Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
panipat1990
Creator II
Creator II

Help

Hi sir,

     How to load multiple csv file in qlikview like excel.Please Help me.

18 Replies
panipat1990
Creator II
Creator II
Author

let vExcelFilePath = 'C:\Users\admin\Desktop\excel';

let vQVDFilePath='C:\Users\admin\Desktop\excel\QVD';

SUB CreateQVDFromAllExcelFiles(vPath)

FOR EACH vFileExtension IN 'csv'

FOR EACH vFile IN FILELIST(vPath & '\*.' & vFileExtension);

ODBC CONNECT32 TO [Excel Files;DBQ=$(vFile)];

Temp:

LOAD *;

SQLtables;

DISCONNECT;

Data:

LOAD * INLINE [

junk ];

FOR i = 0 TO NOOFROWS('Temp')-1

LET vSheetName = PURGECHAR(PURGECHAR(PEEK('TABLE_NAME', i, 'Temp'), CHR(39)), CHR(36));

CONCATENATE(Data)

LOAD  *,

      FILEBASENAME() AS FileName,

     '$(vSheetName)' AS Sheet_name

FROM $(vFile)(ooxml, embedded labels, table is [$(vSheetName)]);

NEXT i

DROP TABLE Temp;

DROP FIELD junk;

// When there is blank sheet in excel an extra Field 'A' is created.

LET vCheckA= IF(FIELDNUMBER('A','Data')>0,'1','0'); // If variable value is 1 means Field A is created due to blank sheet in excel

IF $(vCheckA) =1 THEN

DROP FIELD A;

ELSE

LET vCheckA =NULL();

ENDIF

LET i= NULL();

LET vSheetName=NULL();

NEXT vFile

NEXT vFileExtension

STORE Data into $(vQVDFilePath)\FullData.qvd;

//DROP Table Data;

LET vFileExtension=NULL();

LET vFile =NULL();

END SUB

CALL CreateQVDFromAllExcelFiles('$(vExcelFilePath)');

exit Script;

sunny_talwar

I don't see any variable vSheetName getting created above

Capture.PNG

panipat1990
Creator II
Creator II
Author

but when i use this code for loading  excel then no problem is facing...

sunny_talwar

Can you may be share the logfile for when you try to run the csv file?

panipat1990
Creator II
Creator II
Author

Where this option to attach file in reply box

sunny_talwar

Check here: Uploading a Sample

trdandamudi
Master II
Master II

You click on reply and then on the top right hand side corner click on 'Use advanced editor". You will see "Attach" in the bottom right hand side corner.

panipat1990
Creator II
Creator II
Author

Hi Sunny,

Actually, i want to Store final application(All Sheets Used In Application) in qvd.Is it possible in qlikview.Please guide me.if is it possible. 

Chanty4u
MVP
MVP