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 upload 2 excel files at a time

Hi frnds,

i have 2 excel files in which it has 2 sheets each....

i want to load both of them at a tym.

in 1st excel file

1st sheet is

d sheet is

In 2nd excel seet we have

1st & 2nd sheet is

i want to load both the excel files using for loop?Plzzzzzzzzzzzzzzzzz helpppppppppppppppppppppppp

write the scripting code plssssss

14 Replies
Chanty4u
MVP
MVP

hi

u can use

$(vExcelsheets)' & ' *.xls)

hope this helps you

Thank you

Suresh

krishna20
Specialist II
Specialist II

Chanty4u
MVP
MVP

sry,

u can try this

ForEach vFile in FileList('$(vPath)'& ' *.xls)

Anonymous
Not applicable
Author

Hi Arjun,

Try below script if you have same columns in multiple sheets of a Excel file.

// Configure sheet names to this variable

SET vSheetNames = 'Jan Sales', 'Feb Sales','Mar Sales','Apr Sales','May Sales','Jun Sales','Jul Sales';

// Loop through the sheets and load the data

for each vSheetName in $(vSheetNames)

Data:

LOAD *

     '$(vSheetName)' AS SheetName

FROM

[test.xlsx]

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

NEXT

OR

The second is no need to mention the Sheet name just remove the table is *** .

Note: This method only works for XLSX.

Data:

LOAD *

     '$(vSheetName)' AS SheetName

FROM

[test.xlsx]

(ooxml, embedded labels, header is 2 lines);

ankitbisht01
Creator
Creator

Hi, you can easy load both the excel and all the sheets in those excel at the same time easily with very simple code,

but i do think data modeling will get effected. here is the output as per our need. steps need to do.

1. You have to put your all excel at same folder.

2. This code i load all excel file  and all the sheets.

PFA

Regards

Ankit Bisht