Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP 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
Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

Anil_Babu_Samineni

This line should be this?
FOR each file in filelist( Root\*.xlsm)
Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

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
Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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)
Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)