Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
AREA | ACTIVE | FILENAME |
---|---|---|
North | 1 | 201510_North_Party.txt |
South | 1 | 201510_South_Party.txt |
East | 0 | 201510_East_Party.txt |
West | 1 | 201510_West_Party.txt |
Is there a way to have one load statement that loops through the table and loads the 3 files?
thanks
Stuart
It does seem to take distinct count. I went to check the QlikView Help: QlikView ‒ FieldValueCount - script and chart function
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
FieldValueCount and FieldValue functions always return distinct values only. So no worry about duplicates while using FieldValueCOunt & FieldValue functions.
Yup I had a similar finding. Just need to test if it performs better over Count and Concat aggregations