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

How to use fields of input file in output file name?

Hi:
I imported a text file to database, for example: field1, field2 and field3, and when I dealt the filed2 and export another text file, I need to use the field in output file name, for example: aafield2.txt.
How to do?
Any help would be greatly appreciated.
Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hi
You need to iterate each row and set a dynamic file name. For example:
tFileInputDelimited--row1--tFlowToIterate--iterate--tFixedFlowInput--main--tFileOutputDelimited
on tFixedFlowInput: generate the current data flow, define the same fields as tFileInputDelimited, which you want to output, on the schema, for example: define two columns:field1, field2
column:value
field1 0683p000009MPcz.pngString)globalMap.get("row1.field1")
field2 0683p000009MPcz.pngString)globalMap.get("row1.field2")
on tFileOutputDelimited: define a dynamic file name, feg:
"D:/file/aa"+(String)globalMap.get("row1.field2")+".txt"