<?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 Merge a table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Merge-a-table/m-p/1639879#M594951</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have someting like:&lt;/P&gt;&lt;P&gt;Id, Asc1, Asc2&lt;/P&gt;&lt;P&gt;1, 1,&lt;/P&gt;&lt;P&gt;1, 2,&lt;/P&gt;&lt;P&gt;1, 2,&lt;/P&gt;&lt;P&gt;1, 3,&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; , 1&lt;/P&gt;&lt;P&gt;1, , 2&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; ,4&lt;/P&gt;&lt;P&gt;2, 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And i want to get:&lt;/P&gt;&lt;P&gt;Id, Asc1, Asc2&lt;/P&gt;&lt;P&gt;1, 1, 1&lt;/P&gt;&lt;P&gt;1, 2, 2&lt;/P&gt;&lt;P&gt;1, 3,&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; ,4&lt;/P&gt;&lt;P&gt;2, 1,&lt;/P&gt;&lt;P&gt;That is, every record has either Asc1 or Asc2. If Asc1 equals Asc2 for the same Id, I want those records merged, and keep the rest as they are.&lt;/P&gt;&lt;P&gt;Thanks a lot in advance&lt;/P&gt;</description>
    <pubDate>Fri, 25 Oct 2019 11:35:32 GMT</pubDate>
    <dc:creator>Pedro_Rodriguez</dc:creator>
    <dc:date>2019-10-25T11:35:32Z</dc:date>
    <item>
      <title>Merge a table</title>
      <link>https://community.qlik.com/t5/QlikView/Merge-a-table/m-p/1639879#M594951</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have someting like:&lt;/P&gt;&lt;P&gt;Id, Asc1, Asc2&lt;/P&gt;&lt;P&gt;1, 1,&lt;/P&gt;&lt;P&gt;1, 2,&lt;/P&gt;&lt;P&gt;1, 2,&lt;/P&gt;&lt;P&gt;1, 3,&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; , 1&lt;/P&gt;&lt;P&gt;1, , 2&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; ,4&lt;/P&gt;&lt;P&gt;2, 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And i want to get:&lt;/P&gt;&lt;P&gt;Id, Asc1, Asc2&lt;/P&gt;&lt;P&gt;1, 1, 1&lt;/P&gt;&lt;P&gt;1, 2, 2&lt;/P&gt;&lt;P&gt;1, 3,&lt;/P&gt;&lt;P&gt;1,&amp;nbsp; ,4&lt;/P&gt;&lt;P&gt;2, 1,&lt;/P&gt;&lt;P&gt;That is, every record has either Asc1 or Asc2. If Asc1 equals Asc2 for the same Id, I want those records merged, and keep the rest as they are.&lt;/P&gt;&lt;P&gt;Thanks a lot in advance&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 11:35:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merge-a-table/m-p/1639879#M594951</guid>
      <dc:creator>Pedro_Rodriguez</dc:creator>
      <dc:date>2019-10-25T11:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Merge a table</title>
      <link>https://community.qlik.com/t5/QlikView/Merge-a-table/m-p/1639886#M594952</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Table:
LOAD Id&amp;amp;'|'&amp;amp;If(Len(Trim(Asc1)) = 0, 0, Asc1)&amp;amp;'|'&amp;amp;If(Len(Trim(Asc2)) = 0, 0, Asc2) as Key,
	 Id,
	 If(Len(Trim(Asc1)) &amp;gt; 0, Asc1) as Asc1,
	 If(Len(Trim(Asc2)) &amp;gt; 0, Asc2) as Asc2;
LOAD * INLINE [
    Id, Asc1, Asc2
    1, 1
    1, 2
    1, 2
    1, 3
    1, , 1
    1, , 2
    1, , 4
    2, 1
];

FinalTable:
NoConcatenate
LOAD Key as Key1,
	 Id,
	 Asc1
Resident Table
Where Len(Trim(Asc1)) &amp;gt; 0;

Left Join (FinalTable)
LOAD Key as Key2,
	 Id,
	 Asc2 as Asc1,
	 Asc2
Resident Table
Where Len(Trim(Asc2)) &amp;gt; 0;

Concatenate (FinalTable)
LOAD Key,
	 Id,
	 Asc1,
	 Asc2
Resident Table
Where Not Exists(Key2, Key) and not Exists(Key1, Key); 

DROP Table Table;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Oct 2019 11:57:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Merge-a-table/m-p/1639886#M594952</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-25T11:57:11Z</dc:date>
    </item>
  </channel>
</rss>

