<?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 Re: How to map data in multiple rows to a single record in a table in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-map-data-in-multiple-rows-to-a-single-record-in-a-table/m-p/2241199#M28437</link>
    <description>&lt;P&gt;hey there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also wanted to know that hpw to map data in multiple rows without being confused and easy to accessible.&lt;/P&gt;&lt;P&gt;Thanks for sharing these information and images. I just want to ask, Will somebody guide me personally???&lt;/P&gt;</description>
    <pubDate>Thu, 04 Oct 2018 12:30:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-04T12:30:42Z</dc:date>
    <item>
      <title>How to map data in multiple rows to a single record in a table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-map-data-in-multiple-rows-to-a-single-record-in-a-table/m-p/2241198#M28436</link>
      <description>&lt;P&gt;Hello everyone&lt;/P&gt; 
&lt;P&gt;I have a query that returns between 1 and 8 rows; Within each row is a column value that I want to map to a table. The&amp;nbsp;columns I want to map to are:&lt;BR /&gt;PREREQUISITE_UNIT_CODE1&lt;BR /&gt;PREREQUISITE_UNIT_CODE2&lt;BR /&gt;PREREQUISITE_UNIT_CODE3&lt;BR /&gt;PREREQUISITE_UNIT_CODE4&lt;BR /&gt;PREREQUISITE_UNIT_CODE5&lt;BR /&gt;PREREQUISITE_UNIT_CODE6&lt;BR /&gt;PREREQUISITE_UNIT_CODE7&lt;BR /&gt;PREREQUISITE_UNIT_CODE8&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;and the source data is:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Talend-map-rows-to-columns-data.PNG" style="width: 465px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0AO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/158215i184EF187C52FFC22/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0AO.png" alt="0683p000009M0AO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;In this example there are 5 rows so row 1 with mmb_seq = 1 should be mapped to&amp;nbsp;&lt;SPAN&gt;PREREQUISITE_UNIT_CODE1; the row&amp;nbsp;with mmb_seq = 2 should be mapped to&amp;nbsp;PREREQUISITE_UNIT_CODE2 and so on.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;The job is as below. The table should be updated with values in the prereq_unit_code column.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Talend-map-rows-to-columns-job.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M01r.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136634i7B1F0C316999FABB/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M01r.png" alt="0683p000009M01r.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;The tMap is as below:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Talend-tmap-rrows-to-columns.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0AT.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139828iE4759069B3C9D358/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0AT.png" alt="0683p000009M0AT.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The expression that maps the row to the column takes the form:&lt;/P&gt; 
&lt;PRE&gt;(PrerequisiteUnit.mmb_seq.equals("001") ?
PrerequisiteUnit.prereq_unit_code : "") &lt;/PRE&gt; 
&lt;P&gt;The mmb_seq check increments for each expression up to "008".&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;The job runs but only the last column in the target table is updated (PREREQUISITE_UNIT_CODE5); No other columns are populated. If I split the lookup table into 5 lookups, filitering on the mmb_seq value then the job works but this isn't practical as I have a number of categories of data like this so would lead to a proliferation of lookups.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Hope this makes sense - Andrew&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 11:22:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-map-data-in-multiple-rows-to-a-single-record-in-a-table/m-p/2241198#M28436</guid>
      <dc:creator>sheftalenduser</dc:creator>
      <dc:date>2018-10-04T11:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to map data in multiple rows to a single record in a table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-map-data-in-multiple-rows-to-a-single-record-in-a-table/m-p/2241199#M28437</link>
      <description>&lt;P&gt;hey there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also wanted to know that hpw to map data in multiple rows without being confused and easy to accessible.&lt;/P&gt;&lt;P&gt;Thanks for sharing these information and images. I just want to ask, Will somebody guide me personally???&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 12:30:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-map-data-in-multiple-rows-to-a-single-record-in-a-table/m-p/2241199#M28437</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-04T12:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to map data in multiple rows to a single record in a table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-map-data-in-multiple-rows-to-a-single-record-in-a-table/m-p/2241200#M28438</link>
      <description>&lt;P&gt;hey there, I also wanted to know that hpw to map data in multiple rows without being confused and easy to accessible. Thanks for sharing these information and images. I just want to ask, Will somebody guide me personally ???&lt;/P&gt;</description>
      <pubDate>Sat, 06 Oct 2018 05:53:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-map-data-in-multiple-rows-to-a-single-record-in-a-table/m-p/2241200#M28438</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-06T05:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to map data in multiple rows to a single record in a table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-map-data-in-multiple-rows-to-a-single-record-in-a-table/m-p/2241201#M28439</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt; 
&lt;P&gt;Having failed to tempt anyone to offer a solution I've finally come up with one though it's not very elegant.&lt;/P&gt; 
&lt;P&gt;I've created a subjob that runs first to acquire the source data and associated lookup data as below.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Talend-map-rows-to-columns-hashmap-job.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0UE.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152812i3C1CE46E8BA71D87/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0UE.png" alt="0683p000009M0UE.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;The code for the tJavaFlex is as follows:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Talend-map-rows-to-columns-tjavaflex-job.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M0UO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151733i36E4EECDACDE7686/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M0UO.png" alt="0683p000009M0UO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;The code for the Java method is below&lt;/P&gt; 
&lt;PRE&gt;public static String getMapValue(Object obj, String seq) {
		@SuppressWarnings("unchecked")
		HashMap&amp;lt;String, String&amp;gt; map = (HashMap&amp;lt;String, String&amp;gt;)obj;
		String ret = "";
		ret = map.get(seq);
		return ret;
	}&lt;/PRE&gt; 
&lt;P&gt;The method lookup is done in the tMap as below:&lt;/P&gt; 
&lt;PRE&gt;Module.getMapValue(globalMap.get("locationsMap"), "001") &lt;/PRE&gt; 
&lt;P&gt;Any comments/alternative approaches are welcome.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Andrew&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LtlR"&gt;Talend-map-rows-to-columns-tjavaflex-job.PNG&lt;/A&gt;</description>
      <pubDate>Mon, 15 Oct 2018 14:13:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-map-data-in-multiple-rows-to-a-single-record-in-a-table/m-p/2241201#M28439</guid>
      <dc:creator>sheftalenduser</dc:creator>
      <dc:date>2018-10-15T14:13:03Z</dc:date>
    </item>
  </channel>
</rss>

