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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Loop for Excel

Hey ALL,

hope can anyone help :

i have many excel files here is ana example of  want

first excel file is "file2015' and the seconde is "file2016" each has many sheets

i need to read from file2015 the sheet1 and concatenate it with sheet1 from "file2016"

maybe you can help by giving me a loop that help to do this task,

Thank you,


3 Replies
p_verkooijen
Partner - Specialist II
Partner - Specialist II

//create a empty table to concatenate to

ExcelData:

LOAD * INLINE [

     Fieldname];

Then use FROM file*.xls....

Concatenate (ExcelData)

LOAD *

FROM file*.xls ......

Or use loop

For each File in FileList ('file*.xls')

    

     Concatenate (ExcelData)

     LOAD *

     FROM file*.xls ......

Next File

Not applicable

Hi Mario,

If i understand what you look for, you want to make a loop to concatenate two sheets from two files.

Try with this script:

for each File in FileList ('*.xls')

DataBase:

load *,

from [$(File)]

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

next;

If you want to concatenate sheets, you have to proceed like this:

For each vSheet in 'Sheet1$', 'Sheet2$','Sheet3$' etc...

DataBase:

LOAD

*

FROM

[Excel.xls]

(biff, embedded labels, table is [$(vSheet)]);

next;

But if I was known exactly what you need to do I could give you the exact solution.

Best regards