<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Talend Data Mapper xml input - looking up values in a separate loop in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Talend-Data-Mapper-xml-input-looking-up-values-in-a-separate/m-p/2329095#M98312</link>
    <description>&lt;P&gt;hi!&amp;nbsp; I have an xml file similar to the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;travelData&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;Profiles&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Profile id=1 name="George"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Profile id=2 name="Henry"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Profile id=3 name="Bob"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Profile id=4 name="Eugene"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;Profiles&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;travelDetail&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;travelSegment type="AIR" &amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Price value="205.55" currency="USD"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ProfileReference id = 2/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ProfileReference id=3/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/travelSegment&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;/travelDetail&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;travelData&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To create my JSON output, I loop over the travelSegments with the profileReferences nested, and build separate transactions for each profile reference like:&lt;/P&gt;
&lt;P&gt;"travelData":[&lt;/P&gt;
&lt;P&gt;{"type":"AIR",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "name":"Henry",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "price":205.55,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "currency":"USD"&lt;/P&gt;
&lt;P&gt;},&lt;/P&gt;
&lt;P&gt;{"type":"AIR",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "name":"Bob",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "price":205.55,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "currency":"USD"&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've got the thmap generating&lt;/P&gt;
&lt;P&gt;"travelData":[&lt;/P&gt;
&lt;P&gt;{"type":"AIR",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "profileId":2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "price":205.55,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "currency":"USD"&lt;/P&gt;
&lt;P&gt;},&lt;/P&gt;
&lt;P&gt;{"type":"AIR",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "profileId":3,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "price":205.55,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "currency":"USD"&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I lookup the profile reference id in the Profiles array to get the name corresponding to the profileReference id?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried many things including AgConcatFirstPresentValue, but it always grabs just the first value even if I filter the Profiles loop by the id = ProfileReference (at least for the ids included in the profileReference).&amp;nbsp; Is there a way to get just the profile with the id in the 2nd loop?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you!&lt;/P&gt;</description>
    <pubDate>Fri, 23 Mar 2018 00:24:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-03-23T00:24:33Z</dc:date>
    <item>
      <title>Talend Data Mapper xml input - looking up values in a separate loop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Talend-Data-Mapper-xml-input-looking-up-values-in-a-separate/m-p/2329095#M98312</link>
      <description>&lt;P&gt;hi!&amp;nbsp; I have an xml file similar to the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;travelData&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;Profiles&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Profile id=1 name="George"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Profile id=2 name="Henry"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Profile id=3 name="Bob"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;Profile id=4 name="Eugene"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;Profiles&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;travelDetail&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;travelSegment type="AIR" &amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Price value="205.55" currency="USD"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ProfileReference id = 2/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ProfileReference id=3/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/travelSegment&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;/travelDetail&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;travelData&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To create my JSON output, I loop over the travelSegments with the profileReferences nested, and build separate transactions for each profile reference like:&lt;/P&gt;
&lt;P&gt;"travelData":[&lt;/P&gt;
&lt;P&gt;{"type":"AIR",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "name":"Henry",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "price":205.55,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "currency":"USD"&lt;/P&gt;
&lt;P&gt;},&lt;/P&gt;
&lt;P&gt;{"type":"AIR",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "name":"Bob",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "price":205.55,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "currency":"USD"&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've got the thmap generating&lt;/P&gt;
&lt;P&gt;"travelData":[&lt;/P&gt;
&lt;P&gt;{"type":"AIR",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "profileId":2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "price":205.55,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "currency":"USD"&lt;/P&gt;
&lt;P&gt;},&lt;/P&gt;
&lt;P&gt;{"type":"AIR",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "profileId":3,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "price":205.55,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "currency":"USD"&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I lookup the profile reference id in the Profiles array to get the name corresponding to the profileReference id?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried many things including AgConcatFirstPresentValue, but it always grabs just the first value even if I filter the Profiles loop by the id = ProfileReference (at least for the ids included in the profileReference).&amp;nbsp; Is there a way to get just the profile with the id in the 2nd loop?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 00:24:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Talend-Data-Mapper-xml-input-looking-up-values-in-a-separate/m-p/2329095#M98312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-23T00:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Talend Data Mapper xml input - looking up values in a separate loop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Talend-Data-Mapper-xml-input-looking-up-values-in-a-separate/m-p/2329096#M98313</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I used a set variable:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 773px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lt1D.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140412i7CFB282D1EADA756/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lt1D.png" alt="0683p000009Lt1D.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Then I get this variable:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 750px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LtB9.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157018i389DB3CB939B9BB7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LtB9.png" alt="0683p000009LtB9.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I uploaded my map.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Let me know if it meets your requirements.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Eric&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LsGV"&gt;TRAVEL_MAP.zip&lt;/A&gt;</description>
      <pubDate>Fri, 23 Mar 2018 08:22:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Talend-Data-Mapper-xml-input-looking-up-values-in-a-separate/m-p/2329096#M98313</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-23T08:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Talend Data Mapper xml input - looking up values in a separate loop</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Talend-Data-Mapper-xml-input-looking-up-values-in-a-separate/m-p/2329097#M98314</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp; It worked like a charm.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 17:21:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Talend-Data-Mapper-xml-input-looking-up-values-in-a-separate/m-p/2329097#M98314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-23T17:21:22Z</dc:date>
    </item>
  </channel>
</rss>

