Combine two Row's into one Column

One Star

Combine two Row's into one Column

Hello everybody,
i know that the subject is not well chosen, but I have problems to describe my problem in one sentence. First of all I attached an overview over my job (Talend Open Studio for DI 5.3.1).
Quick description of the steps:
tSOAP_1 -> Connect to a SOAP webservice (Output as Document)
t_ExtractXMLField_2 -> Extract IDs from response
tSOAP_3 -> Load data (dependent from the IDs) from a SOAP webservice (Output as Document)
tExtractXMLField_6 -> Extract some information from the from teh response
tExtractXMLField_3 -> From the previous step one "Document" was outputed so I extract information from that
tJavaRow_1 -> Now I collect all data from previous

As you can see in attachment "hc_003.png" the step 'tExtractXMLField_6' output a variable with name 'Answers' (type=Document) from which I extraxt in 'tExtractXMLField_3' some information. The content of 'Answers' looks like:
<Answers>
<Answer>
<AnswerId>4711</AnswerId>
<QNr>1</QNr>
<QId>1234567</QId>
<QText>Some question text</QText>
<QMechanism>1</QMechanism>
<QMText></QMText>
<QType>WRadio</QType>
<AValue>6</AValue>
<AText>5</AText>
<AWeight>5</AWeight>
</Answer>
<Answer>
<AnswerId>4712</AnswerId>
<QNr>2</QNr>
<QId>8901234</QId>
<QText>No 2 question</QText>
<QMechanism>1</QMechanism>
<QMText></QMText>
<QType>Text</QType>
<AValue>The answer</AValue>
<AText>The answer</AText>
<AWeight></AWeight>
</Answer>
</Answers>

So my 'tExtractXMLField_3' give 'tJavaRow_1' two rows.

What I need is, that this two rows (<Answer>) are combined into on row.
Somethink like this:
AnswerId-1: 4711
AnswerId-2: 4712
QText-1: Some question text
QText-2: No 2 question
AText-1: 5
AText-2: The answer
...

So I have finally one row with all <Answer> objects.
Note that the 'tSOAP_3' returned multiple rows (each row should be one row in the result). Each row has multiple "<Answer>" which should be in one row.

Unfortunately I have no idea which componet can do this. Smiley Sad
Hope someone have a usefull hint for me.

Thanks a lot and greetings from Germany
Four Stars

Re: Combine two Row's into one Column

Hi,
You can think of using tMemorizeRows component....
Check if this approach suits you.
https://help.talend.com/search/all?query=tMemorizeRows&content-lang=en
Thanks
Vaibhav
One Star

Re: Combine two Row's into one Column

Hi,
You can think of using tMemorizeRows component....
Check if this approach suits you.
https://help.talend.com/search/all?query=tMemorizeRows&content-lang=en
Thanks
Vaibhav

Thanks for this hint, i will check this out and give you a feedback.