Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community
I have some file names in my table. I would like to use them as variables within the "from" command?
Is there any possibility to create such variables?
Thank you for your help
Robert
Yes, for example like this. Imagine that we have a table called Filenames with a single field called FName. Every row contains a different QVD file name.
:
FOR i = 0 TO NoOfRows('Filenames')-1
LET vFName = peek('FName', i);
Table:
LOAD * FROM [$(vFName)] (qvd);
NEXT
:
There are many more complex examples available in the community,
Yes, for example like this. Imagine that we have a table called Filenames with a single field called FName. Every row contains a different QVD file name.
:
FOR i = 0 TO NoOfRows('Filenames')-1
LET vFName = peek('FName', i);
Table:
LOAD * FROM [$(vFName)] (qvd);
NEXT
:
There are many more complex examples available in the community,
You have first to read the table as is than use peek function inside a for statement to reach the goal.
Something like:
OriginalTab:
Load
Field1,
Field2,
...
From db.table1;
For n=0 to NoOfRow(OriginalTab)
Let vSource = peek('Field1',n,'OriginalTab');
if n=0 then
NewTable:
NoConcatenate
Load
*
From $(vSource);
Else
Concatenate(NewTable)
Load
*
From $(vSource);
End if
Next
drop table OriginalTab;
Thank you Michele
Regards
Robert
Thank you Peter
it was realy helpful
regards
Robert
Hi Robert ,
If you get right answer then please close this thread to mark right answer.
Thanks
Please,
when applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.
Regards