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

How to load all folder in qlikview

hi all

please refer the below link

http://http//qlikviewmaven.blogspot.com/2008/09/loading-all-of-files-from-.html

http://qlikviewmaven.blogspot.com/2008/09/loading-all-of-files-from-folder.html

in this they are explaining about. hoe to load all excel files from a folder. Now I want to know I have a folder called YEAR in that YEAR folder I have different folder called 2009, 2010, 2011 and 2012.

Now I want to load all files from all these year folder by using * but it wont work in folder. Is there any other option to achieve this.

Regards,

Sheela,

1 Solution

Accepted Solutions
ekech_infomotio
Partner - Creator II
Partner - Creator II

Although Vijay's proposal will work and is easy to unterstand (in this simple case), I personally prefer constructs like

set vBaseDir = '\\whereever\your\subfolders\may\be';

for each vYear in '2009', '2010', '2011', '2012'

     directory '$(vBaseDir)\$(vYear)';

     for each vFile in filelist('$(vFileBaseName)*.xls')

          load

                *

          from  

               $(vFile) (whatever has to be here to load your xls-files correctly);

     next vFile

     ;

next vYear

;

Although this may look a bit complicated, it will give you more control over what will be loaded.

Hope this will help.

Greetings,

Edgar

View solution in original post

5 Replies
vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi Usha,

You can use loop here

For i=Startyear to EndYear

Load

*

From ..\Data\$(i)\*.xls

Next i

Hope this will help.

Not applicable
Author

Hi vijay

thanks for your reply, prob in startyear and endyear things. will you please attach your application. It will help me a lot.

Regards,

Sheela

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi ,

I am using personal edition so I cant share my apps.

If you know what is you first year and last year then you can create variablesn and use them:

Let StartYear = 2008;

Let  EndYear=2012;

For i=$(StartYear) to $(EndYear)

Load *

...

Next i

Hope this will help.

ekech_infomotio
Partner - Creator II
Partner - Creator II

Although Vijay's proposal will work and is easy to unterstand (in this simple case), I personally prefer constructs like

set vBaseDir = '\\whereever\your\subfolders\may\be';

for each vYear in '2009', '2010', '2011', '2012'

     directory '$(vBaseDir)\$(vYear)';

     for each vFile in filelist('$(vFileBaseName)*.xls')

          load

                *

          from  

               $(vFile) (whatever has to be here to load your xls-files correctly);

     next vFile

     ;

next vYear

;

Although this may look a bit complicated, it will give you more control over what will be loaded.

Hope this will help.

Greetings,

Edgar

Not applicable
Author

Do you know what happened to the links? I am not able to open it 😞