Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Fred12
Contributor III
Contributor III

How to concatenate all xlsx from a folder

Hello, I got a folder with a lot of xlsx ( maybe 200) but they have all same column

My aim is to concatenate all xlsx file 

So, I did that : 

 

For Each file in FileList('lib://Sharepoint/Shared Doc/Off/01- ds/01- coll/1.01 preno\*.xlsx')
final_table:
LOAD
*
FROM [$(file)] (ooxml, embedded labels, table is [RENDU]);
Next file;

 

 

It returns me no error but no data too.

Someone could explain me if I'm wrong and how I need to do 

Thanks for reading me 

Labels (3)
13 Replies
Chanty4u
MVP
MVP

Try this s

Concatenate (final_table)

LOAD *

FROM [lib://Sharepoint/Shared Doc/Off/01- ds/01- coll/1.01 preno/*.xlsx]

(ooxml, embedded labels, table is [RENDU]);

Fred12
Contributor III
Contributor III
Author

Thanks for answering, but it doesn't work.

 

I need to do a loop   for the next step of my project 

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

 

In your loop can you add a trace

 

Trace $(file);

 

to see if the loop is ok.

 

And you can try to replace the last \ by a / in :

'lib://Sharepoint/Shared Doc/Off/01- ds/01- coll/1.01 preno\*.xlsx'

Help users find answers! Don't forget to mark a solution that worked for you!
Fred12
Contributor III
Contributor III
Author

Yes I did that but my loop return me nothing

Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

It's a Sharepoint 365 ?

 

Have read this ?

https://community.qlik.com/t5/Suggest-an-Idea/SharePoint-Connector-August-2022-read-in-multiple-file...

Help users find answers! Don't forget to mark a solution that worked for you!
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

It's not realy user friendly...

 

But first you neeed to load file list from your Sharepoint Metadata and loop over this list.

 

LIB CONNECT TO 'SHP_EXTERNAL_METADATA';

LOAD 
	Name as [ListFiles.Name]
    ;

SELECT 
	Name
FROM ListFiles
WITH PROPERTIES (
subSite='/sites/Information_System/IS-BI-Reporting',
folder='/sites/Information_System/IS-BI-Reporting/Documents/10 - DWH 2.0',
maxResults='40'
);



for Each vFile in FieldValueList('ListFiles.Name')

Trace $(vFile);

Next vFile

 

 

 

Help users find answers! Don't forget to mark a solution that worked for you!
Fred12
Contributor III
Contributor III
Author

I already got a conection on qliksense for this

 

Kushal_Chawda

@Fred12  How many sheets all files have? Do they have different sheet names?

Fred12
Contributor III
Contributor III
Author

Hello, no for the moment, I try just with 1 folder for 1 file xlsx and 1 sheet

In sharepoint connector in qliksense, I got a base url and site/subsite path

 

Should I Use it ?