<?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 join rows where the ID is same in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-join-rows-where-the-ID-is-same/m-p/2153225#M1225045</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/3349"&gt;@vikasshana&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You are essentially asking for a reverse crosstable, which in Qlik is a generic load. The generic load process however results in multiple tables, so in my example below, I've joined them back together. After that process, we rename the fields according to your if() statements.&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;LI-CODE lang="markup"&gt;RawData:
LOAD * INLINE [
ID,CODE,PARTNER
1,WE,AB
1,AG,CD
1,RE,EF
];

GenericData:
GENERIC LOAD * RESIDENT RawData;

FinalTable:
LOAD DISTINCT ID RESIDENT RawData;

FOR i = NoOfTables()-1 to 0 STEP -1;
	LET vTable=TableName($(i));
    IF WildMatch('$(vTable)','GenericData.*') THEN
    	LEFT JOIN ([FinalTable]) LOAD * RESIDENT [$(vTable)];
		DROP TABLE [$(vTable)];
    ENDIF
NEXT i

Map_FieldNames:
MAPPING LOAD * INLINE [
	OLD		,NEW
    WE		,party1
    AG		,party2
    RE		,party3
];

RENAME Fields USING Map_FieldNames;
DROP TABLE RawData;&lt;/LI-CODE&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;P&gt;I referenced this &lt;A href="https://community.qlik.com/t5/App-Development/Joining-multiple-generic-loads/td-p/1528646" target="_self"&gt;post&lt;/A&gt; as part of my solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 19:46:52 GMT</pubDate>
    <dc:creator>Daniel_Pilla</dc:creator>
    <dc:date>2023-12-14T19:46:52Z</dc:date>
    <item>
      <title>How to join rows where the ID is same</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-join-rows-where-the-ID-is-same/m-p/2153162#M1225042</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've below sample data&lt;/P&gt;
&lt;P&gt;Table:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;ID,CODE,PARTNER&lt;BR /&gt;1,WE,AB&lt;BR /&gt;1,AG,CD&lt;BR /&gt;1,RE,EF&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;FinalTable:&lt;BR /&gt;Load ID,&lt;BR /&gt;if(CODE = 'WE',PARTNER) as party1,&lt;BR /&gt;if(CODE = 'AG',PARTNER) as party2,&lt;BR /&gt;if(CODE = 'RE',PARTNER) as party3&lt;BR /&gt;Resident Table;&lt;/P&gt;
&lt;P&gt;Drop Table Table;&lt;/P&gt;
&lt;P&gt;Output Received:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vikasshana_0-1702572514783.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/125466i61BB82B25C3AF43B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vikasshana_0-1702572514783.png" alt="vikasshana_0-1702572514783.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Expected Output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vikasshana_1-1702572573203.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/125467iD26A8892901E4374/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vikasshana_1-1702572573203.png" alt="vikasshana_1-1702572573203.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;looking for load script to achieve above.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;v&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 16:50:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-join-rows-where-the-ID-is-same/m-p/2153162#M1225042</guid>
      <dc:creator>vikasshana</dc:creator>
      <dc:date>2023-12-14T16:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to join rows where the ID is same</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-join-rows-where-the-ID-is-same/m-p/2153225#M1225045</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/3349"&gt;@vikasshana&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You are essentially asking for a reverse crosstable, which in Qlik is a generic load. The generic load process however results in multiple tables, so in my example below, I've joined them back together. After that process, we rename the fields according to your if() statements.&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;LI-CODE lang="markup"&gt;RawData:
LOAD * INLINE [
ID,CODE,PARTNER
1,WE,AB
1,AG,CD
1,RE,EF
];

GenericData:
GENERIC LOAD * RESIDENT RawData;

FinalTable:
LOAD DISTINCT ID RESIDENT RawData;

FOR i = NoOfTables()-1 to 0 STEP -1;
	LET vTable=TableName($(i));
    IF WildMatch('$(vTable)','GenericData.*') THEN
    	LEFT JOIN ([FinalTable]) LOAD * RESIDENT [$(vTable)];
		DROP TABLE [$(vTable)];
    ENDIF
NEXT i

Map_FieldNames:
MAPPING LOAD * INLINE [
	OLD		,NEW
    WE		,party1
    AG		,party2
    RE		,party3
];

RENAME Fields USING Map_FieldNames;
DROP TABLE RawData;&lt;/LI-CODE&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;P&gt;I referenced this &lt;A href="https://community.qlik.com/t5/App-Development/Joining-multiple-generic-loads/td-p/1528646" target="_self"&gt;post&lt;/A&gt; as part of my solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 19:46:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-join-rows-where-the-ID-is-same/m-p/2153225#M1225045</guid>
      <dc:creator>Daniel_Pilla</dc:creator>
      <dc:date>2023-12-14T19:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to join rows where the ID is same</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-join-rows-where-the-ID-is-same/m-p/2153449#M1225055</link>
      <description>&lt;P&gt;thanks for that, this is what the expected output which I'm looking for.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Dec 2023 08:44:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-join-rows-where-the-ID-is-same/m-p/2153449#M1225055</guid>
      <dc:creator>vikasshana</dc:creator>
      <dc:date>2023-12-15T08:44:45Z</dc:date>
    </item>
  </channel>
</rss>

