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

Extract entire folder

Hi,

I have one folder contains many xls files.

I want to extract entire folder,how to extract it in qlikview.

10 Replies
Anil_Babu_Samineni

Is that folder carrying 10 Excels. So, does 10 excels having same structure of fields??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dhavalvyas
Contributor III
Contributor III
Author

yes all the fields are same

Chanty4u
MVP
MVP

can you tell me the  file names list?

for example your filenames like below

Sample_jan17

Sample_feb17

Sample_mar17 ....... like so on..

test:

load *,

..

..

FROM

(ooxml, embedded labels, table is Sheet1);

tresesco
MVP
MVP

Try using wildcard character like:

LOAD

          *

FROM

[<your path>\ *.xls]

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

Anil_Babu_Samineni

Can you call them it is using Sub directory

SET Path = '\*.xls';

SUB DoDir (Root)

FOR each File_Copy in filelist(Root& '$(Path)')

LOAD * FROM [$(File_Copy)] (biff, embedded labels);

NEXT File_Copy


FOR each AllFiles in dirlist (Root&'\*')

Call DoDir(AllFiles)

NEXT AllFiles

END SUB

CALL DoDir('AZ:\Prod\Sample\Folder\AMI63')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
devarasu07
Master II
Master II

Hi,

have you tried this method?

Loading Multiple Excel files to QlikView | Qlik Community

Load all Excel files and all sheets in a folder

basic code:

let ExcelSource = 'D:\Excel Source\Sales*.xlsx';

for each File in filelist (ExcelSource)

    AllData:

    LOAD * FROM $(File) (ooxml, embedded labels, table is Sheet1);

next File

shiveshsingh
Master
Master

You can try with wildcard character

LOAD

          *

FROM

[<File path>\ *.xls]

dhavalvyas
Contributor III
Contributor III
Author

Should we specify any field name after load * , statement ? As I am using your code but it is not working ? after extracting it I have to store it in .csv file

Anil_Babu_Samineni

There are 4 replies including me, How come we know which script you used for?Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful