Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Shady
Contributor
Contributor

Arrays in Qlik

I am new to Qlik and I am trying to find max value of a particular column in all the qvd files in a folder (column name is same). I wrote the code to loop though the folder and to read the max value of the column. Now I want to load the max values into an array after each file qvd file has been read. Can some one help me with this:

This is the code I have written till now:

 

sub Dates(dummy)
for each file in fileList('$(vQVDRawLocation)'&'\*.qvd')

if FileSize('$(File)') > 0 then
AutoNumberQVDDate:
LOAD DISTINCT QVDDATE
Resident TempTable;
AutoNumber1:
LOAD max(QVDDATE) AS Key
Resident AutoNumberQVDDATE;

let vAutoNumber1 = Peek('Key',0,'AutoNumber1');
end if
next File

end sub

Labels (1)
2 Replies
lironbaram
Partner - Master III
Partner - Master III

reply 

hi you can do like this 

this will create one table with Key column and the values from each file 

for each file in fileList('$(vQVDRawLocation)'&'\*.qvd')

if FileSize('$(File)') > 0 then
AutoNumberQVDDate:
LOAD max(QVDDATE) AS Key
from [$(file)] (qvd);


end if
next file

 

Shady
Contributor
Contributor
Author

Thank you but I just found that one of the files do not have the same column name, so this wont work.