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

Loading Multiple Excel files

I have result set in Multiple Excels ,How Can i Load it in Qlik View

Load *

From

[Path\ * .xlsx]

is not working

7 Replies
Not applicable
Author

You can try to load one by one in qlik as usual : in qlik go to Edit script and then table files. and then you can choose the files one at time.

its_anandrjs

Hi Shruti,

Try this ways

LET Path = 'E:\';

Load *, FileName() as FileName

From

[$(Path)\*.xlsx]

(ooxml, embedded labels, table is [$(*)]);

Regards,

Anand

Anonymous
Not applicable
Author

Hi

You can upload multiple excel files or multiple sheets for an excel files. Both is possible in the script.

Here you have an example for files '.qv'

DIRECTORY C:\Users\KonoGes\Documents;

Set Root='C:\Users\KonoGes\Documents';

for each Ext in 'qvw', 'qva', 'qvo', 'qvs'

       for each Dir in dirlist ('$(Root)'&'\*')

            for each File in filelist (Dir&'\*.' &Ext)

  Load

            '$(File)' as Name,

            FileSize( '$(File)' ) as Size,

            FileTime( '$(File)' ) as FileTime,

            Subfield('$(File)', '\', 1+SubStringCount('$(File)', '\')) as Fichero,

            left('$(File)', index('$(File)', '\', -1)) as Directorio

  autogenerate 1;

            next File

      next Dir

next Ext

// here $(File)' is list of files in directory.

// You can modify as required.

Anonymous
Not applicable
Author

Anonymous
Not applicable
Author

Hi

i think your code is missing (ooxml, embedded labels, table is [$(sheetName)])

[$(sheetName)] is the sheet name

try this code if you have multiple sheets in each excel file

for each file in FileList('C:\test\*.xlsx');

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

  tables:

  SQLtables;

  DISCONNECT;

  FOR i = 0 to NoOfRows('tables')-1

  LET sheetName = purgeChar(purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39)), chr(36));

  Table:

  Load *,'$(sheetName)' as SheetName

  From $(file)(ooxml, embedded labels, table is [$(sheetName)]);

  NEXT i

  Drop table tables;

  //set tables=Null;

  Next file

Regards

Harsha

Not applicable
Author

Thanks Harsha ur code really does work

Anonymous
Not applicable
Author

Hi Shruti

please close the post which so that it will be helpful to others.

Regards

Harsha