Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set tFileList Filemask from records in SQL Table

I would like to dynamically set the filemask parameter of a tFileList component using records queried from a SQL Table.
for instance:
FileMask now:
GL_*.xls
Query distinct records from a table, results in:
12345
23456
34567
FileMask wanted:
GL_12345.xls
GL_23456.xls
GL_34567.xls
I assume the code would be similar to:
tFileList1.add.files(GL_12345.xls)
Thanks,
Jim
Labels (2)
5 Replies
alevy
Specialist
Specialist

Why do you need tFileList if you know from the table what the file names are? You can just iterate through the table records processing the files as required. Looking at the code generated by tFileList, it appears that you can't add file masks dynamically. The best you could do would be to pre-define a number of context or globalMap variables to use in your tFileList and then populate those variables from your table records.
Anonymous
Not applicable
Author

Good point, I hadn't thought about taking that direction. The process is a bit more complex than in my example, but it's still a valid option.
Anonymous
Not applicable
Author

A bit more detail, we also have the period end date as a portion of the filename so the FileList use is still worthwhile. Below is actually the filemask needed as we can receive files for multiple periods as well as files from facilities we're not yet ready to process.
FileMask wanted:
GL_12345_*.xls
GL_23456_*.xls
GL_34567_*.xls
alevy
Specialist
Specialist

I would suggest then just having one globalMap variable used as part of your tFileList mask and iterate through your table records to populate the variable and call tFileList.
Anonymous
Not applicable
Author

Terrific! Thanks so much for your help and suggestions.