Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
zwyne
Creator
Creator

Dynamically Loading Multiple Excel Files in folders

Hi there,

I have a code which loads Excel files from a folder, its working fine in QlikView but when I try in QlikSense it's not working. Please assist with the correct syntax. Please the code below

 SUB DoDir(Root)
FOR each file in filelist( Root & '\*.xlsm')    
  
Table:     
LOAD [MI ID],
     [Issue Type],
     [Business Area],
     Impacted_Business_Function,
     [Assessment Unit],
     Responsible_Business_Function,
     Country,
     Risk,
     Process,
     [Report Title],
     [Issue Creation Date],
      Floor(MonthEnd(Today()))-Date(Floor([Issue Creation Date])) as Num_Of_Days, 
         Date(Date#(SubField(FileBaseName(),'_',-1),'DDMMYYYY')) as Date
  
From $(file)(ooxml, embedded labels, table is [Issues]) ;
  
NEXT file
FOR each Dir in Dirlist (Root&'\*')

     CALL DoDir(Dir)

NEXT Dir
end sub
CALL DoDir('C:\Users\abbz079\Desktop\Issue Management\QVData');
2 Solutions

Accepted Solutions
Anil_Babu_Samineni

Qlikview can capture the side of full path. Where as qliksense need library like
CALL DoDir(['Lib:\Issue Management\QVData]');

Where library holds the full path
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

Anil_Babu_Samineni

This line should be this?
FOR each file in filelist( Root\*.xlsm)
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

3 Replies
Anil_Babu_Samineni

Qlikview can capture the side of full path. Where as qliksense need library like
CALL DoDir(['Lib:\Issue Management\QVData]');

Where library holds the full path
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
zwyne
Creator
Creator
Author

Thank for the response, 

so when I load one file at a time the path is :

FROM [lib://QVData/Issues Management Tracker_01092018.xlsm]
(ooxml, embedded labels, table is Issues);

So my question do I use the forward  or back slash and also is this correct


FOR each file in filelist( Root & '\*.xlsm')?

 

Anil_Babu_Samineni

This line should be this?
FOR each file in filelist( Root\*.xlsm)
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful