<?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: Compare 2 field and find the difference from 2 table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976758#M1220811</link>
    <description>&lt;P&gt;It works. Thank you so much! Can I check with you, so if there's 2 same row in table 2, it will only be included one time am I right?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Sep 2022 06:21:00 GMT</pubDate>
    <dc:creator>heather97</dc:creator>
    <dc:date>2022-09-05T06:21:00Z</dc:date>
    <item>
      <title>Compare 2 field and find the difference from 2 table</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976739#M1220806</link>
      <description>&lt;P&gt;Hi everyone, looking for some help!&lt;/P&gt;
&lt;P&gt;Suppose I have 2 tables with the same exact fields. I want to find the new Name and country from table 2 as compared to table1. If the Name and country does not match with the Name and country in table 1 then it will be created in a new table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;E.g.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Table1:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Name&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Country&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Gender&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;John&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;USA&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Male&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Kevin&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;UK&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Male&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Mary&lt;/TD&gt;
&lt;TD&gt;UK&lt;/TD&gt;
&lt;TD&gt;Female&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;June&lt;/TD&gt;
&lt;TD&gt;UK&lt;/TD&gt;
&lt;TD&gt;Female&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Table 2:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Name&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Country&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Gender&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Ariel&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;USA&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Female&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Kevin&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;UK&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Male&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Mary&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;UK&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Female&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;John&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;UK&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Male&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;STRONG&gt;Result&lt;/STRONG&gt; will be:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Name&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Country&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Gender&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;Ariel&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;USA&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Female&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%"&gt;John&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;UK&lt;/TD&gt;
&lt;TD width="33.333333333333336%"&gt;Male&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Since John in Table 2, his country is different from table 1, thus, John - UK should be added in the new table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Directory;&lt;BR /&gt;Table1:&lt;/P&gt;
&lt;P&gt;LOAD Name as uniqueName, &lt;BR /&gt;Country, &lt;BR /&gt;Gender&lt;BR /&gt;FROM&lt;BR /&gt;[File1.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Table1);&lt;/P&gt;
&lt;P&gt;Directory;&lt;BR /&gt;Table2:&lt;BR /&gt;Concatenate(Table1)&lt;BR /&gt;LOAD Name, &lt;BR /&gt;Country, &lt;BR /&gt;Gender&lt;BR /&gt;FROM&lt;BR /&gt;[File2.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is [Table2])&lt;BR /&gt;WHERE Not Exists(UniqueName, Name);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-PRODUCT title="QlikView" id="qlikView"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 05:02:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976739#M1220806</guid>
      <dc:creator>heather97</dc:creator>
      <dc:date>2022-09-05T05:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 field and find the difference from 2 table</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976752#M1220808</link>
      <description>&lt;P&gt;If you want to check for multiple fields, they need to be included in your exists filter.&lt;/P&gt;
&lt;P&gt;Maybe this does what you need?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table1:
LOAD 
	Name,
	Country,
	Gender,
	Name &amp;amp;'|'&amp;amp; Country &amp;amp;'|'&amp;amp; Gender as PersonFilter
FROM
	[File1.xlsx]
	(ooxml, embedded labels, table is Table1);


CONCATENATE(Table1)
Table2:
LOAD 
	Name,
	Country,
	Gender
FROM
	[File2.xlsx]
	(ooxml, embedded labels, table is Table2)
WHERE 
	not Exists(PersonFilter, Name &amp;amp;'|'&amp;amp; Country &amp;amp;'|'&amp;amp; Gender);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 06:09:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976752#M1220808</guid>
      <dc:creator>oskartoivonen</dc:creator>
      <dc:date>2022-09-05T06:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 field and find the difference from 2 table</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976754#M1220809</link>
      <description>&lt;P&gt;Hello, thanks for the reply, would try that out. Do I need to include the gender if I am ignoring that field for filter?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 06:14:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976754#M1220809</guid>
      <dc:creator>heather97</dc:creator>
      <dc:date>2022-09-05T06:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 field and find the difference from 2 table</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976756#M1220810</link>
      <description>&lt;P&gt;Only include the fields which you need to combine and compare, so if name and country are sufficient, use just those two.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 06:15:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976756#M1220810</guid>
      <dc:creator>oskartoivonen</dc:creator>
      <dc:date>2022-09-05T06:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 field and find the difference from 2 table</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976758#M1220811</link>
      <description>&lt;P&gt;It works. Thank you so much! Can I check with you, so if there's 2 same row in table 2, it will only be included one time am I right?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 06:21:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976758#M1220811</guid>
      <dc:creator>heather97</dc:creator>
      <dc:date>2022-09-05T06:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Compare 2 field and find the difference from 2 table</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976759#M1220812</link>
      <description>&lt;P&gt;If you want to avoid duplicates from Table2, you need to create the PersonFilter-field in Table2 LOAD as well. If you do this, it'll add the new row to the filter after concatenation and prevent additional rows from the same LOAD.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 06:23:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-2-field-and-find-the-difference-from-2-table/m-p/1976759#M1220812</guid>
      <dc:creator>oskartoivonen</dc:creator>
      <dc:date>2022-09-05T06:23:31Z</dc:date>
    </item>
  </channel>
</rss>

