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

generate multiple rows in Tjavarow

Hi,

   I am trying to format a column based on a shrinking window array and coming up with multiple combinations.

 

I have created the java code for it but I am unable to use it in tjavarow. To simplify here is the example.

 

the trial_id is '123456' and the condition is "ABCDED :: XYZ"

 

String r[] = input_row.conditions.split(" :: ");
for (int i=0; i<r.length;i++)
{
output_row.trial_id = input_nct_trial_id;
output_row.fragments=r[i];
}

 

The issue is I am only getting one row in output the first one 123456|ABCDED and not the second one 123456|XYZ

 

I am new to talend so not even sure if this is supported or not?

 

Labels (2)
1 Solution

Accepted Solutions
JR1
Creator III
Creator III

I believe what you should be looking at is the tNormalize component. This will at least replace the piece of Java code you are showing here. 

 

If you have the two columns "trial_id" and "condition" as input, you would normalize the column "condition" and use the item separator "::". This will give you the two rows you are looking for (or even three or more if you have something like "ABCDED :: XYZ :: MNOP" in there). Set the "Trim resulting values" in this component as your input seems to have spaces. If you need a different name for your output column ("fragments"), you could use a tMap after the tNormalize component.

View solution in original post

3 Replies
jeoste
Creator II
Creator II

Hello,
Can you provide an example of the components you're using in input and the link with you tJavarow ?
I'm not sure, but you might replace your tJavarow component by a tJavaFlex by checking "Data Auto Propagate" and using a "iterate row" instead of a "main row". Keep us in touch
JR1
Creator III
Creator III

I believe what you should be looking at is the tNormalize component. This will at least replace the piece of Java code you are showing here. 

 

If you have the two columns "trial_id" and "condition" as input, you would normalize the column "condition" and use the item separator "::". This will give you the two rows you are looking for (or even three or more if you have something like "ABCDED :: XYZ :: MNOP" in there). Set the "Trim resulting values" in this component as your input seems to have spaces. If you need a different name for your output column ("fragments"), you could use a tMap after the tNormalize component.

Anonymous
Not applicable
Author

what i findout was that tjavarow and tjavaa only outputs one row out for one row in. i did the processing and outputed all results in one column and used tnormalize to split up the result.

 

My logic was doing far more than just a split, it was just a question to get the basic splitting of one row into multiple rows output. but it was not working.