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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
gadje1
Creator
Creator

Iterate data from tJava

Hi everybody,

I would be able to iterate on data from a tJava Component and put all rows in a tMap or in a tFileOutputDelimited for example.

Here is my job :

 

0683p000009M8xc.jpgIf someone knows how to do ...

Thanks a lot.

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,

 

After your tjava component, put a tFileOutputDelimited or whatever,

pull a "main" link between your tjava and the Output Component

you will see the main link named "rowX".

 

In tjava write :

rowX.value = ((String)globalMap.get("row1.value"));

Regards,

Pierre

View solution in original post

6 Replies
Anonymous
Not applicable

Hi,

 

After your tjava component, put a tFileOutputDelimited or whatever,

pull a "main" link between your tjava and the Output Component

you will see the main link named "rowX".

 

In tjava write :

rowX.value = ((String)globalMap.get("row1.value"));

Regards,

Pierre

gadje1
Creator
Creator
Author

Merci beaucoup, jesuisengalere.

C'est exactement ce que je souhaite faire.

Fonctionne impeccable.

 

Bon WE

gadje1
Creator
Creator
Author

Hi Jesuisengalere,

Your solution is right for outputs in console mode but if i want rescue the data in a tFileoutputDelimited i juste have the last data line. Is there a solution to write all the lines in a CSV file ? I guess that there is but i dont know the way to do it.

 

Here is my job :
0683p000009M8y6.jpg

 

 

Thanks a lot.

Anonymous
Not applicable

On the tfileoutputDelimited component, you have a 'Append file' checkbox or 'Ecrire après' in French Version.

 

Regards

Pierre

gadje1
Creator
Creator
Author

i saw the checkbox but is there an other solution because if i do it like that, i'll need to delete my file everytime that i will execute my job.

Anonymous
Not applicable

The append checkbox permits to write after the selected documents, if it doesnt exist, it will be initialised.

If you have an error telling you that the file already exists, you will have to uncheck a 'die if file exists' checkbox located in the Advanced Setting of the components if i remember right.