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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Output 'input' filename to table

I using a tfileinputdelimited to take the input from a text file, using t-replace to make some changes to it and using tmysqloutput to output it to a table.
This is what I want to do, I want to add a column to the table for all the entries which should have the name of the text file i am using in tfileinputdelimited.
Can I do that and if yes, how?
Could you also please tell me how to call a stored procedure from mysql?
Thanks so much
Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hello
Can I do that and if yes, how?

Of course, there are several ways to finish it.
1)
tFileList_1--iterate-->tFileInputDelimited--->tMap--tMysqlOutput
on tFileList, choose the direcotry where the file locates on, set the file mask as file name.
on tMap, add a new column, set the expression as: ((String)globalMap.get("tFileList_1_CURRENT_FILE"))
2)
tFileProperties---tJavaRow
|
onsubjobok
|
tFileInputDelimited--->tMap--tMysqlOutput
on tJavaRow: globalMap.put("filename",input_row.basename);
on tMap, add a new column and set the expression as: (String)globalMap.get("filename")
Could you also please tell me how to call a stored procedure from mysql?

See the related 4278
Best regards
shong
Anonymous
Not applicable
Author

If I go with the first option, that is tfilelist, I would still need to set the file mask as the file name for each job. What if I wanted to automate the complete process, can it in no way pick up the file mask automatically from Fileinputdelimited?