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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sofiene92
Contributor
Contributor

Create files dynamically

Hello,
I use TOS 2.3.1 and I'm working on a Java project.
I have a table with 3 fields : NOMFICHIER (which is the filename), DATE and RAPPORT.
These 3 fields are string fields, and their respective length : 12 for NOMFICHIER, 20 for DATE and 70 for RAPPORT.
After that, I want to create a file for each NOMFICHIER, but I don't know what component I have to use, and how to use them...
My table :
NOMFICHIER|DATE|RAPPORT
123456789.12|2008-05-29 11:42:34|Établissement : 123
123456789.12|2008-05-29 11:42:34|Nombre de A : 625
123456789.12|2008-05-29 11:42:34|Nombre de B : 2718
123456789.12|2008-05-29 11:42:34|Nombre de C : 9868
123456789.12|2008-05-29 11:42:34|Nombre de D : 196
987654321.12|2008-05-29 11:42:34|Établissement : 456
987654321.12|2008-05-29 11:42:34|Nombre de A : 515
987654321.12|2008-05-29 11:42:34|Nombre de B : 2688
987654321.12|2008-05-29 11:42:34|Nombre de C : 6459
987654321.12|2008-05-29 11:42:34|Nombre de D : 0

Finally, I want to put these data dynamically in respective new file (file positionnal), with dynamic filename :
File : 123456789.12.txt
NOMFICHIER|DATE|RAPPORT
123456789.12|2008-05-29 11:42:34|Établissement : 123
123456789.12|2008-05-29 11:42:34|Nombre de A : 625
123456789.12|2008-05-29 11:42:34|Nombre de B : 2718
123456789.12|2008-05-29 11:42:34|Nombre de C : 9868
123456789.12|2008-05-29 11:42:34|Nombre de D : 196
File : 987654321.12.txt
NOMFICHIER|DATE|RAPPORT
987654321.12|2008-05-29 11:42:34|Établissement : 456
987654321.12|2008-05-29 11:42:34|Nombre de A : 515
987654321.12|2008-05-29 11:42:34|Nombre de B : 2688
987654321.12|2008-05-29 11:42:34|Nombre de C : 6459
987654321.12|2008-05-29 11:42:34|Nombre de D : 0
I have tried with tFor, tForeach, tJava Row, toFlowtoIterate, but It doesn't work, what I have to do?
Thanks for your answers!

Sofiene92
Labels (3)
10 Replies
Anonymous
Not applicable

Hi,

to late or note
see the job for the tSendMail 3335

replace tSendMail by tFileOutputDelimited in append mode and a context variable or glogal variable defined in the tJava.

get inspiration

Jeremie