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

load specific sheet from multiple excel files

Hi Firends

I want to load a speceific excel sheet from several excel files  I have written following code to load one file. Pls help me to modify the code load next file and thereafter till all files in the folder are loaded

CrossTable(CLASS, AMOUNT, 3)

LOAD * FROM

G:\PRD_PROFIT\AAEXP.xls

(biff, embedded labels, table is HO$);

1 Solution

Accepted Solutions
HirisH_V7
Master
Master

You can use,

*EXP For loading all the files ending with EXP.


CrossTable(CLASS, AMOUNT, 3)

LOAD * FROM

G:\PRD_PROFIT\*EXP.xls

(biff, embedded labels, table is HO$);

HTH,

Hirish

HirisH
“Aspire to Inspire before we Expire!”

View solution in original post

6 Replies
sushil353
Master II
Master II

you can use this subroutine:

sub ScanFolder(Root)

          for each FileExtension in 'qvw','mp3','ape','flac','ogg'

                    for each FoundFile in filelist( Root & '\*.' & FileExtension)

                              FileList:

                              Load

                                        '$(FoundFile)'                     as [FilenameWithPath],

                                        '$(FileExtension)'           as [Extension]

                              Autogenerate(1);

                    next FoundFile

          next FileExtension

          for each SubDirectory in dirlist( Root & '\*' )

                    call ScanFolder(SubDirectory)

          next SubDirectory

end sub

Call ScanFolder('.') ;

upaliwije
Creator II
Creator II
Author

It is bit difficult for me to understand. If you can pls share an example QV file

HirisH_V7
Master
Master

Can you please mention ,How a file name should be like i.e ending parameters of each file should be like,

For example is it like,

AAEXP.XLS

AAEXP1.XLS

AAEXP2.XLS

AAEXP3.XLS

AAEXP4.XLS

etc,,;

Or any other format.

-Hirish




HirisH
“Aspire to Inspire before we Expire!”
upaliwije
Creator II
Creator II
Author

AAEXP,GAEXP,KDEXP,KUEXP LIKE THAT

HirisH_V7
Master
Master

You can use,

*EXP For loading all the files ending with EXP.


CrossTable(CLASS, AMOUNT, 3)

LOAD * FROM

G:\PRD_PROFIT\*EXP.xls

(biff, embedded labels, table is HO$);

HTH,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
upaliwije
Creator II
Creator II
Author

Thanks