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

Loading file which exists in a file list, loop?

Hi,

I'm looking for a way to only load files where they exist in a table similar to the below where the ACTIVE flag is set to 1.

AREAACTIVEFILENAME

North

1201510_North_Party.txt
South1201510_South_Party.txt
East0201510_East_Party.txt
West1201510_West_Party.txt

Is there a way to have one load statement that loops through the table and loads the 3 files?

thanks

Stuart

13 Replies
sunny_talwar

It does seem to take distinct count. I went to check the QlikView Help: QlikView ‒ FieldValueCount - script and chart function

sunny_talwar

Not sure if it is more efficient or not, but I do like dathu's way of doing it as well (thanks for introducing a new method to me, as I was having aggregation issue on server and I am going to test if I can use your method as a workaround)

Table:

LOAD FILENAME

FROM

[https://community.qlik.com/thread/200275]

(html, codepage is 1252, embedded labels, table is @1)

Where ACTIVE = 1;

FOR i = 1 to FieldValueCount('FILENAME')

  LET vFile = FieldValue('FILENAME', $(i));

  Table:

  LOAD Dim,

      Value

  FROM

  $(vFile)

  (txt, codepage is 1252, embedded labels, delimiter is ',', msq);

NEXT i

Not applicable
Author

FieldValueCount and FieldValue functions always return distinct values only. So no worry about duplicates while using FieldValueCOunt & FieldValue functions.

sunny_talwar

Yup I had a similar finding. Just need to test if it performs better over Count and Concat aggregations