Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dmac1971
Creator II
Creator II

Load data from files in an array.

I know its possible to load data from all files in a folder with a specific naming convention, ie *Data.qvd etc.  Is it possible to do something similar but use the file names from an array or table within QV?

Say load all data from :

C:/Data/Jan_Sales.xls

C/Data/Feb_Sales.xls

C/Data/Mar_Sales_Adj.xls

Etc

I'm pulling data from multiple files over google drive and sometimes the files get renamed so would be simplier to correct in one location rather than multiple?  I'm sure you could do it with variables as well, but this would be cleaner for me?

Thanks in advance.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

It's possible, but it requires a variable as well.

// an array

For Each vFile in 'File1.xls','File2.xls','File3.xls'

     MyTable:

     Load * FROM [$(vFile)] (biff, ...etc ...);

Next

// a table, can be any kind of table loaded inline or from a text file, or excel file or database etc.

Files:

LOAD * INLINE [

Filename

C:/Data/Jan_Sales.xls

C:/Data/Feb_Sales.xls

C:/Data/Mar_Sales_Adj.xls

];

For i =1 to NoOfRows(Files)-1

     LET vFile = peek('Filename',$(i),'Files');

     MyTable:

     Load * FROM [$(vFile)] (biff, ...etc ...);

Next


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

It's possible, but it requires a variable as well.

// an array

For Each vFile in 'File1.xls','File2.xls','File3.xls'

     MyTable:

     Load * FROM [$(vFile)] (biff, ...etc ...);

Next

// a table, can be any kind of table loaded inline or from a text file, or excel file or database etc.

Files:

LOAD * INLINE [

Filename

C:/Data/Jan_Sales.xls

C:/Data/Feb_Sales.xls

C:/Data/Mar_Sales_Adj.xls

];

For i =1 to NoOfRows(Files)-1

     LET vFile = peek('Filename',$(i),'Files');

     MyTable:

     Load * FROM [$(vFile)] (biff, ...etc ...);

Next


talk is cheap, supply exceeds demand
dmac1971
Creator II
Creator II
Author

Gysbert,

Thank you appreciated, fairly simple when you see it like that.  Should improve my script greatly.

Dermot