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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

spliting files an renaming files

Hi,
I'm new on Talend.
I'm trying to create a file for each row I have in my database and want to rename each file whith a unique variable I have in the row.
My input file is a mysql database, I use a tmap before spliting in multiples files using xmloutput composant.
I try to put a variable in the "+("row1.id")+".xml", I have a null1, null2, null3 ....
Thanks for help
Sorry for my english
Labels (4)
20 Replies
Anonymous
Not applicable
Author

Hello,
Thanks very much for your help !
It works now ! I have all my files with the right name but XML fields are now empty except for the EAN.
Do I have to set global var for each field ? Where ?
Anonymous
Not applicable
Author

I try to set all vars in the tjavaflex ! It works for row11
row10.SERIEL=globalMap.get("row11.SERIEL").toString(); WORK
row10.ISBN=globalMap.get("row11.ISBN").toString(); WORK
row10.EAN=globalMap.get("row11.EAN").toString(); WORK
row10.AGEDEB=globalMap.get("row9.cum_age").toString(); DOESN'T WORK
Any help please ?
Anonymous
Not applicable
Author

the tFlowToIterate is what is putting the row values into the global map. row9 is not being processed by the flowToIterate-- so its values will not be put into the global map.
looking at your screenshots, all you would need to do is include the "cum_age" column in your row11 output table in the tMap, then you will be able to pull it out of the global map like all the other row11 values.
Anonymous
Not applicable
Author

I put the row9.cum_age in row11.AGEDEB in the TMAP but when I do a row10.AGEDEB =globalMap.get("row11.AGEDEB ").toString(); in the tjava flex it doesn't work
error
Exception in component tJavaFlex_1
java.lang.NullPointerException
at webedition.test_0_1.test.tMysqlInput_2Process(test.java:3428)
at webedition.test_0_1.test.runJobInTOS(test.java:5371)
at webedition.test_0_1.test.main(test.java:5243)
Anonymous
Not applicable
Author

are you still refering to it with this?
row10.EAN=globalMap.get("row9.cum_age").toString();
if so, change it to:
row10.EAN=globalMap.get("row11.AGEDB").toString();
Anonymous
Not applicable
Author

I made an error sorry it's not
row10.EAN=globalMap.get("row9.cum_age").toString();
but
row10.AGEDB=globalMap.get("row9.cum_age").toString();
I tried both, they don't work.
row10.AGEDB=globalMap.get("row11.AGEDB").toString();
row10.AGEDB=globalMap.get("row9.cum_age").toString();
Anonymous
Not applicable
Author

Just a little help for this please ! 0683p000009MACn.png
Anonymous
Not applicable
Author

Can you post a few more screenshots of what you're working with? Please include the inside of the tMap and tJavaFlex.
Anonymous
Not applicable
Author

Now I manage to get the row11.ean name for filename and i can set globalvar for every row11 that came from the row6 but
it doesn't work for those which came from row8 or row9 so I can fill my xml file with all fields.
The line row10.AGEDEB=globalMap.get("row11.AGEDEB").toString(); in the tjavaflex doesn't work
Maybe I have to make a join in the tjavaflex but how ?

Here is the flow, the tmap and the tJavaFlex

Thanks
Anonymous
Not applicable
Author

Hello
I still can't make it work,
Thanks