Aggregation and multiple loops in tHMap

One Star

Aggregation and multiple loops in tHMap

With tHMap I want to map an incoming xml file to a flat structure of data integration columns. The mapping can be viewed in the attached screenshots. As you can see, there a multiple 1:n structures in the xml. I need to loop over one of them (measurementValue->value) an I want to aggregate another one (householdServingSize->Description->text). Both of these elements have the  mutual parent foodAndBeverageNutrientInformation. What I want to achieve is, that for each measurementValue under the foodAndBeverageNutrientInformation node an aggreated concatenation of the householdServingSize->Description->text is done.
But when I define the aggregation like in the screenshot, not only the text-elements under the foodAndBeverageNutrientInformation-node are concatenate. The aggregation concatenates all text-elements in the whole document.
How can it be done that only the text-elements under the same foodAndBeverageNutrientInformation-node as the measerumentValue-node are aggregated?



loop-test.… .txt
One Star

Re: Aggregation and multiple loops in tHMap

loop-test.xml.txt_20140828-1237.txt
One Star

Re: Aggregation and multiple loops in tHMap

My attached screenshots seem to be missing and my attached xml-file cannot be viewed. What am i doing wrong?
Moderator

Re: Aggregation and multiple loops in tHMap

Hi monseesa,
Are you able to upload your image by chicking "Upload" button or dropping your file into "Drop files here to attache them" field?
What's the browser are you using? Could you please paste your loop-test.xml.txt_20140828-1237.txt file intpo forum directly?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Aggregation and multiple loops in tHMap

Hi xdshi,
I'm using Firefox 30.0, and I tried both - the upload button and the "Drop Files"-Field. When I click on upload, I can see that I have already 12 pages under "My Uploads", but they are not shown in my post.
Here's the XML:
<?xml version="1.0" encoding="UTF-8"?>
                      <catalogueItem>
                        <tradeItem>
                           <tradeItemIdentification>
                              <gtin>1234</gtin>
                           </tradeItemIdentification>                         
                           <extension>
                                 <tradeItemExtension>
                                 <foodAndBeverageInformation>
                                    <foodAndBeverageNutrientInformation>
                                       <preparationState>PREPARED</preparationState>
                                       <foodAndBeverageNutrient>
                                          <measurementPrecision>EXACT</measurementPrecision>
                                          <nutrientTypeCode iNFOODSCodeValue="ENER-"/>
                                          <quantityContained>
                                             <measurementValue unitOfMeasure="KJO">
                                                <value>2093</value>
                                             </measurementValue>
                                             <measurementValue unitOfMeasure="E14">
                                                <value>500</value>
                                             </measurementValue>
                                          </quantityContained>
                                       </foodAndBeverageNutrient>
                                       <foodAndBeverageNutrient>
                                          <measurementPrecision>EXACT</measurementPrecision>
                                          <nutrientTypeCode iNFOODSCodeValue="PRO-"/>
                                          <quantityContained>
                                             <measurementValue unitOfMeasure="GR">
                                                <value>7.5</value>
                                             </measurementValue>
                                          </quantityContained>
                                       </foodAndBeverageNutrient>
                                       <householdServingSize>
                                          <description>
                                             <language>
                                                <languageISOCode>de</languageISOCode>
                                             </language>
                                             <text>50 g DE</text>
                                          </description>
                                          <description>
                                             <language>
                                                <languageISOCode>fr</languageISOCode>
                                             </language>
                                             <text>50 g FR</text>
                                          </description>
                                       </householdServingSize>
                                    </foodAndBeverageNutrientInformation>
                                    <foodAndBeverageNutrientInformation>
                                       <preparationState>UNPREPARED</preparationState>
                                       <foodAndBeverageNutrient>
                                          <measurementPrecision>APPROXIMATELY</measurementPrecision>
                                          <nutrientTypeCode iNFOODSCodeValue="ENER-"/>
                                          <percentageOfDailyValueIntake>7</percentageOfDailyValueIntake>
                                          <quantityContained>
                                             <measurementValue unitOfMeasure="KJO">
                                                <value>586</value>
                                             </measurementValue>
                                             <measurementValue unitOfMeasure="E14">
                                                <value>140</value>
                                             </measurementValue>
                                          </quantityContained>
                                       </foodAndBeverageNutrient>
                                       <foodAndBeverageNutrient>
                                          <measurementPrecision>EXACT</measurementPrecision>
                                          <nutrientTypeCode iNFOODSCodeValue="FAT"/>
                                          <percentageOfDailyValueIntake>10</percentageOfDailyValueIntake>
                                          <quantityContained>
                                             <measurementValue unitOfMeasure="GR">
                                                <value>7</value>
                                             </measurementValue>
                                          </quantityContained>
                                       </foodAndBeverageNutrient>
                                       <householdServingSize>
                                          <description>
                                             <language>
                                                <languageISOCode>de</languageISOCode>
                                             </language>
                                             <text>28g ca. 2 Stück</text>
                                          </description>
                                       </householdServingSize>
                                    </foodAndBeverageNutrientInformation>
                                 </foodAndBeverageInformation>
                               </tradeItemExtension>
                            </extension>
                        </tradeItem>
                     </catalogueItem>
Moderator

Re: Aggregation and multiple loops in tHMap

Hi,
I'm using Firefox 30.0, and I tried both - the upload button and the "Drop Files"-Field. When I click on upload, I can see that I have already 12 pages under "My Uploads", but they are not shown in my post.

When you click "upload" button and upload files, make sure the uploaded screenshots is loaded in your current post.
See my screenshots.
Let me know if it is OK with you.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Aggregation and multiple loops in tHMap


 
 

One Star

Re: Aggregation and multiple loops in tHMap

I tried as you said. I saw the screenshots in the reply formular. Then I clicked Preview and saw the screenshots, too. Then I clicked submit, and they are gone. Smiley Sad
Edit: Strange - when I created my post, the uploaded files vanished. But when I edit the post and then attach files, it works.
Thank you!
One Star

Re: Aggregation and multiple loops in tHMap

Doesn't anyone have an idea how this can be done with the new mapping component? Is it not possible with Talend?