<?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 Compare two tables and see only differences - SQL version in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-two-tables-and-see-only-differences-SQL-version/m-p/521811#M1131221</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm very new to QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to compare two tables that should contain the same data, and I found &lt;A _jive_internal="true" href="https://community.qlik.com/thread/32944"&gt;this question&lt;/A&gt;, among others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution offered works beautifully -- with an inline table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I redo the solution with SQL queries (both of which must contain joins) and run in debug mode, &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I get the error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unknown statement&lt;/P&gt;&lt;P&gt;INNER JOIN (Table) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script looks something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET ThousandSep=',';&lt;/P&gt;&lt;P&gt;SET DecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyThousandSep=',';&lt;/P&gt;&lt;P&gt;SET MoneyDecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyFormat='$#,##0.00;($#,##0.00)';&lt;/P&gt;&lt;P&gt;SET TimeFormat='h:mm:ss TT';&lt;/P&gt;&lt;P&gt;SET DateFormat='MM/DD/YYYY';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='MM/DD/YYYY h:mm:ss[.fff] TT';&lt;/P&gt;&lt;P&gt;SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&lt;/P&gt;&lt;P&gt;SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO connection_string;&lt;/P&gt;&lt;P&gt;LOAD [columns]&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;, 'Table 1' as Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM some_table&lt;/P&gt;&lt;P&gt;inner join [statements];&lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO different_connection_string;&lt;/P&gt;&lt;P&gt;LOAD [columns]&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;, 'Table 2' as Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM another_table&lt;/P&gt;&lt;P&gt;&amp;nbsp; INNER JOIN [statements]&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (Table) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Nov 2013 20:25:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-11-13T20:25:08Z</dc:date>
    <item>
      <title>Compare two tables and see only differences - SQL version</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-two-tables-and-see-only-differences-SQL-version/m-p/521811#M1131221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm very new to QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to compare two tables that should contain the same data, and I found &lt;A _jive_internal="true" href="https://community.qlik.com/thread/32944"&gt;this question&lt;/A&gt;, among others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The solution offered works beautifully -- with an inline table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I redo the solution with SQL queries (both of which must contain joins) and run in debug mode, &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I get the error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unknown statement&lt;/P&gt;&lt;P&gt;INNER JOIN (Table) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script looks something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET ThousandSep=',';&lt;/P&gt;&lt;P&gt;SET DecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyThousandSep=',';&lt;/P&gt;&lt;P&gt;SET MoneyDecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyFormat='$#,##0.00;($#,##0.00)';&lt;/P&gt;&lt;P&gt;SET TimeFormat='h:mm:ss TT';&lt;/P&gt;&lt;P&gt;SET DateFormat='MM/DD/YYYY';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='MM/DD/YYYY h:mm:ss[.fff] TT';&lt;/P&gt;&lt;P&gt;SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&lt;/P&gt;&lt;P&gt;SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO connection_string;&lt;/P&gt;&lt;P&gt;LOAD [columns]&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;, 'Table 1' as Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM some_table&lt;/P&gt;&lt;P&gt;inner join [statements];&lt;/P&gt;&lt;P&gt;CONCATENATE&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO different_connection_string;&lt;/P&gt;&lt;P&gt;LOAD [columns]&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;, 'Table 2' as Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM another_table&lt;/P&gt;&lt;P&gt;&amp;nbsp; INNER JOIN [statements]&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (Table) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 20:25:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-two-tables-and-see-only-differences-SQL-version/m-p/521811#M1131221</guid>
      <dc:creator />
      <dc:date>2013-11-13T20:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two tables and see only differences - SQL version</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-two-tables-and-see-only-differences-SQL-version/m-p/521812#M1131222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You´re mixing QlikView and SQL sources&lt;/P&gt;&lt;P&gt;You should do&lt;/P&gt;&lt;P&gt;1) Retrieve the data from Source1 (Table1)&lt;/P&gt;&lt;P&gt;2) Retrieve the data from Source2 (Table2) &lt;STRONG&gt;you can´t do a join between them here&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;3)&lt;/P&gt;&lt;P&gt;LOAD * resident Table1&lt;/P&gt;&lt;P&gt;inner join&lt;/P&gt;&lt;P&gt;LOAD * resident Table2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 20:59:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-two-tables-and-see-only-differences-SQL-version/m-p/521812#M1131222</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2013-11-13T20:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two tables and see only differences - SQL version</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-two-tables-and-see-only-differences-SQL-version/m-p/521813#M1131223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this syntax is correct however have not tested it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET ThousandSep=',';&lt;/P&gt;&lt;P&gt;SET DecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyThousandSep=',';&lt;/P&gt;&lt;P&gt;SET MoneyDecimalSep='.';&lt;/P&gt;&lt;P&gt;SET MoneyFormat='$#,##0.00;($#,##0.00)';&lt;/P&gt;&lt;P&gt;SET TimeFormat='h:mm:ss TT';&lt;/P&gt;&lt;P&gt;SET DateFormat='MM/DD/YYYY';&lt;/P&gt;&lt;P&gt;SET TimestampFormat='MM/DD/YYYY h:mm:ss[.fff] TT';&lt;/P&gt;&lt;P&gt;SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&lt;/P&gt;&lt;P&gt;SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO connection_string; &lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD [columns], 'Table 1' as Table;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM some_table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO different_connection_string;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;LOAD [columns], 'Table 2' as Table;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;&amp;nbsp; FROM another_table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Join_Table:&lt;/P&gt;&lt;P&gt;Load * &lt;/P&gt;&lt;P&gt;Resident Table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner Join(Table1)&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;Resident Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Table1;&lt;/P&gt;&lt;P&gt;Drop Table Table2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2013 23:22:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-two-tables-and-see-only-differences-SQL-version/m-p/521813#M1131223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-13T23:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two tables and see only differences - SQL version</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-two-tables-and-see-only-differences-SQL-version/m-p/521814#M1131224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a template that works, for anyone else who's wondering. One of the QlikView developers here helped me out - I'm still at the point where I need very detailed help with syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all who replied. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The connection strings need to precede the LOAD statements for the two tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET ThousandSep=',';&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET DecimalSep='.';&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET MoneyThousandSep=',';&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET MoneyDecimalSep='.';&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET MoneyFormat='$#,##0.00;($#,##0.00)';&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET TimeFormat='h:mm:ss TT';&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET DateFormat='MM/DD/YYYY';&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET TimestampFormat='MM/DD/YYYY h:mm:ss[.fff] TT';&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO first_connection_string;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD columns,&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; 'Table_1' as Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT sql&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO second_connection_string;&lt;/P&gt;&lt;P&gt;CONCATENATE (Table) &lt;/P&gt;&lt;P&gt;LOAD columns&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;, 'Table_2' as Table;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT sql&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (Table)&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;WHERE "Only in One Table?"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt; key&lt;/P&gt;&lt;P&gt;,count(key)&amp;lt;2 as "Only in One Table?"&lt;/P&gt;&lt;P&gt;RESIDENT Table&lt;/P&gt;&lt;P&gt;GROUP BY key&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Nov 2013 18:57:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-two-tables-and-see-only-differences-SQL-version/m-p/521814#M1131224</guid>
      <dc:creator />
      <dc:date>2013-11-20T18:57:58Z</dc:date>
    </item>
  </channel>
</rss>

