<?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: Visualize disparate Data from SQL Sources in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Visualize-disparate-Data-from-SQL-Sources/m-p/999811#M643367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for the reference/code.&lt;/P&gt;&lt;P&gt;I have used this code for comparison of sources.&lt;/P&gt;&lt;P&gt;See Script1 attached for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First we load source (1.1)&amp;nbsp; (trusted data) and suspect data (1.2) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is NO joins between them: &lt;/P&gt;&lt;P&gt;&lt;EM&gt;QUALIFY *;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that we allow the join:&lt;/P&gt;&lt;P&gt;UNQUALIFY *;&lt;/P&gt;&lt;P&gt;and formulate (1.3) the Delta (difference) between sources programmatically:&lt;/P&gt;&lt;P&gt;We allow QVW engine to join by the composite key (i.e. turning the composite key into a surrogate key):&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM&gt;KEY_JOINED&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this part of the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//(1.3) load Source Formulate the difference between the sources programmatically:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;DELTA&lt;/EM&gt;&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Concatenate (SOURCE) &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;AutoNumberHash256 (StateProvinceID, TerritoryID,StateProvinceName,CountryRegionName) as &lt;STRONG&gt;&lt;EM&gt;Autonumbered_Hash&lt;/EM&gt;&lt;/STRONG&gt;, &lt;/P&gt;&lt;P&gt;AutoNumberHash256 (StateProvinceID, TerritoryID,StateProvinceName,CountryRegionName) as SSD_Autonumbered_Hash,&lt;/P&gt;&lt;P&gt;AutoNumberHash256 (StateProvinceID, TerritoryID) as &lt;STRONG&gt;&lt;EM&gt;KEY_JOINED&lt;/EM&gt;&lt;/STRONG&gt;, &lt;/P&gt;&lt;P&gt;&amp;nbsp; StateProvinceID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,StateProvinceCode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,IsOnlyStateProvinceFlag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,StateProvinceName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,TerritoryID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,CountryRegionCode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,CountryRegionName&lt;/P&gt;&lt;P&gt;,'DELTA' as Table;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;from [AdventureWorks2008R2].[Person].[vStateProvinceCountryRegion_STRANGE_DATA];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;INNER JOIN (SOURCE)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; "Only in One Table?"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;OR&amp;nbsp; "Hash Different?"&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;OR "Duplicate or Not Match?"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;KEY_JOINED&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;// (1.4) formulating the 3 data difference scenarios:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,if(count(KEY_JOINED)=1,-1, 0) as "Only in One Table?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,if(maxstring(Autonumbered_Hash)&amp;lt;&amp;gt;minstring(Autonumbered_Hash),-1,0) as "Hash Different?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,if(count(KEY_JOINED) &amp;lt;&amp;gt; 2, -1, 0 ) as "Duplicate or Not Match?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;RESIDENT SOURCE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;GROUP BY KEY_JOINED&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the resulting log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Connecting to UserDSN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Connected&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SOURCE &amp;lt;&amp;lt; [vStateProvinceCountryRegion] 181 lines fetched&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Connecting to UserDSN_STRANGE_DATA&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Connected&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SOURCE_STRANGE_DATA &amp;lt;&amp;lt; [vStateProvinceCountryRegion_STRANGE_DATA] 182 lines fetched&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SOURCE &amp;lt;&amp;lt; [vStateProvinceCountryRegion_STRANGE_DATA] 363 lines fetched&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DELTA &amp;lt;&amp;lt; SOURCE 4 lines fetched&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;See that only 4 rows populate the Delta recordset.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;See that we exposed the source of each data as a column: &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,'SOURCE' as Table; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,'DELTA' as Table;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;See the end result: &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;there are 3 analytic flags, we can filter by them:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;We have reached the goal:&lt;/P&gt;&lt;P&gt;identifying all the main scenarios:&lt;/P&gt;&lt;P&gt;1) Missing data (Quebec missing in suspect data)&lt;/P&gt;&lt;P&gt;2) new rows (NewProvince was missing in the source/correct data)&lt;/P&gt;&lt;P&gt;3) Misspelt rows (see Ontario misspelt, actually number of columns might be in hundreds, so it is very simplified example)&lt;/P&gt;&lt;P&gt;4) duplicate rows (see Alberta below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first column: "table" shows us the source of the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only functional requirement that I did not reach was keeping both sources intact (because I had to concatenate two sources, source data now reduced only to delta/modified data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to make the script simpler?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 723px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="64"&gt;Table&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="111"&gt;Only in One Table?&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="97"&gt;Hash Different?&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="149"&gt;Duplicate or Not Match?&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="94"&gt;CountryRegionCode&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="79"&gt;CountryRegionName&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="129"&gt;StateProvinceName&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;SOURCE&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Alberta&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;DELTA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Alberta&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;SOURCE&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Ontario&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;DELTA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;&amp;lt;MISSPELT&amp;gt;Ontario&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;SOURCE&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Quebec&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;DELTA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;&amp;lt;NEWPROVINCE&amp;gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Dec 2015 22:38:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-12-14T22:38:55Z</dc:date>
    <item>
      <title>Visualize disparate Data from SQL Sources</title>
      <link>https://community.qlik.com/t5/QlikView/Visualize-disparate-Data-from-SQL-Sources/m-p/999809#M643365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We need to compare back-end SQL data from different sources.&lt;/P&gt;&lt;P&gt;Let's say we have an ETL or Operational process.&lt;/P&gt;&lt;P&gt;It processes and modifies&amp;nbsp; data (in mlns).&lt;/P&gt;&lt;P&gt;99.9% of the data is the same.&lt;/P&gt;&lt;P&gt;We need to identify the "Delta" (missing, new, redundant and modified data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data is coming from different sources (different Servers etc).&lt;/P&gt;&lt;P&gt;That is why we can not use full outer join and where not exists in SQL.&lt;/P&gt;&lt;P&gt;We have to do similar functionality programmatically in QLV Load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have one SOURCE of data (=CORRECT) data.&lt;/P&gt;&lt;P&gt;Lets call it: "SOURCE".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a second source (or ETL target) = SUSPECT data.&lt;/P&gt;&lt;P&gt;Lets call it: "STORE SOURCE_STRANGE_DATA".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See data scaffolding:&lt;/P&gt;&lt;P&gt;in SQL Server 2008R2 DB AdventureWorks2008R2&lt;/P&gt;&lt;P&gt;New view created: [&lt;EM style="font-size: 8pt;"&gt;Person].[vStateProvinceCountryRegion_STRANGE_DATA&lt;/EM&gt;]&lt;/P&gt;&lt;P&gt;See Att.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It reproduces all rows from the underlying view: vStateProvinceCountryRegion&lt;/P&gt;&lt;P&gt;correctly except the following 4 rows ("STORE SOURCE_STRANGE_DATA"):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #f4a90a;"&gt;1) Misspelt existing row: '&lt;EM&gt;&amp;lt;MISSPELT&amp;gt;Ontario'&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #f4a90a;"&gt;&lt;STRONG&gt;2) Existing (correct) row duplicated: &lt;EM&gt;Alberta&lt;/EM&gt; duplicated&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #f4a90a;"&gt;&lt;STRONG&gt;3) Missing row: &lt;EM&gt;Quebec&lt;/EM&gt; is missing&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #f4a90a;"&gt;&lt;STRONG&gt;4) NEW row: &lt;EM&gt;&amp;lt;NEWPROVINCE&amp;gt;&lt;/EM&gt;&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;EM style="font-size: 8pt;"&gt;(StateProvinceID=999, i.e. new key identication)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See &lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;CORRECT&lt;/STRONG&gt;&lt;/SPAN&gt; list of provinces:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="337" style="width: 273px; height: 346px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;AB&lt;/TD&gt;&lt;TD width="124"&gt;Alberta&lt;/TD&gt;&lt;TD width="64"&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;BC&lt;/TD&gt;&lt;TD&gt;British Columbia&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;NB&lt;/TD&gt;&lt;TD&gt;Brunswick&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;LB&lt;/TD&gt;&lt;TD&gt;Labrador&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;MB&lt;/TD&gt;&lt;TD&gt;Manitoba&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;NF&lt;/TD&gt;&lt;TD&gt;Newfoundland&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;NT&lt;/TD&gt;&lt;TD&gt;Northwest Territories&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;NS&lt;/TD&gt;&lt;TD&gt;Nova Scotia&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;ON&lt;/TD&gt;&lt;TD&gt;Ontario&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;PE&lt;/TD&gt;&lt;TD&gt;Prince Edward Island&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;STRONG style="color: #008080;"&gt;QC&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;Quebec&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG style="color: #008080;"&gt;CA&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;SK&lt;/TD&gt;&lt;TD&gt;Saskatchewan&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;YT&lt;/TD&gt;&lt;TD&gt;Yukon Territory&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See Suspect List of Provinces (&lt;SPAN style="font-size: 13.3333px;"&gt;"STORE SOURCE_STRANGE_DATA".):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;(Quebec is missing from the list):&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 252px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;&lt;STRONG style="color: #ff6600;"&gt;ON &lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="124"&gt;&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt;&amp;lt;MISSPELT&amp;gt;Ontario&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="64"&gt;&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt;CA&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt;NN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt;&amp;lt;NEWPROVINCE&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG style="color: #ff6600;"&gt;CA&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;STRONG style=": ; color: #993300;"&gt;AB &lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #993300;"&gt;&lt;STRONG&gt;Alberta&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #993300;"&gt;&lt;STRONG&gt;CA&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;SPAN style="color: #993300;"&gt;&lt;STRONG&gt;AB &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="color: #993300;"&gt;&lt;STRONG&gt;Alberta&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG style=": ; color: #993300;"&gt;CA&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;BC&lt;/TD&gt;&lt;TD&gt;British Columbia&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;NB&lt;/TD&gt;&lt;TD&gt;Brunswick&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;LB&lt;/TD&gt;&lt;TD&gt;Labrador&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;MB&lt;/TD&gt;&lt;TD&gt;Manitoba&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;NF&lt;/TD&gt;&lt;TD&gt;Newfoundland&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;NT&lt;/TD&gt;&lt;TD&gt;Northwest Territories&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;NS&lt;/TD&gt;&lt;TD&gt;Nova Scotia&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;PE&lt;/TD&gt;&lt;TD&gt;Prince Edward Island&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;SK&lt;/TD&gt;&lt;TD&gt;Saskatchewan&lt;/TD&gt;&lt;TD&gt;CA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;YT&lt;/TD&gt;&lt;TD&gt;Yukon Territory&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;CA&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functional purpose:&lt;/P&gt;&lt;P&gt;Identify all 4 scenarios, listed above.&lt;/P&gt;&lt;P&gt;1) Keep both sources intact (putting them in the separate tab).&lt;/P&gt;&lt;P&gt;2) Programmatically identify "Delta" (any row that it New/Missing/Changed/Duplicate).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;List of columns (used for comparison) should be easily modified, assume not reliable composite key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have come close to the solution, but still it is pretty bulky.&lt;/P&gt;&lt;P&gt;This solution should be short and robust and may be (auto-generated) code for each of the hundreds of the table&amp;nbsp; (being compared).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the script: (it uses separate DSNs for sources, assuming different servers/connections):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 8pt;"&gt;ODBC CONNECT TO UserDSN;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;SOURCE:&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;LOAD &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;AutoNumberHash256 (StateProvinceID, TerritoryID,StateProvinceName,CountryRegionName) as Autonumbered_Hash, &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; StateProvinceID&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,StateProvinceCode&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,IsOnlyStateProvinceFlag&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,StateProvinceName&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,TerritoryID&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,CountryRegionCode&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,CountryRegionName;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;SQL SELECT &lt;/EM&gt;&lt;/SPAN&gt;&lt;EM style="font-size: 10.6667px; line-height: 1.5em;"&gt;*&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;// correct data:&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;from [AdventureWorks2008R2].[Person].[vStateProvinceCountryRegion]; &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;STORE SOURCE INTO C:\temp\SOURCE.QVD (qvd);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;// ----------------------------------------------------------------------------------------------------------------&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;QUALIFY *;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&lt;STRONG&gt;UNQUALIFY Autonumbered_Hash;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;ODBC CONNECT TO UserDSN_STRANGE_DATA;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&lt;STRONG&gt;SOURCE_STRANGE_DATA:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;// the only way to see(load) new, redundant, chnaged values is right keep (but MISSING values DISSAPEAR from source!)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&lt;STRONG&gt;RIGHT KEEP &lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;LOAD AutoNumberHash256 (StateProvinceID, TerritoryID,StateProvinceName,CountryRegionName) as Autonumbered_Hash,&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;// want to keep it separately for dirty flag detection:&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;AutoNumberHash256 (StateProvinceID, TerritoryID,StateProvinceName,CountryRegionName) as SSD_Autonumbered_Hash,&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; StateProvinceID&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,StateProvinceCode&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,IsOnlyStateProvinceFlag&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,StateProvinceName&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,TerritoryID&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,CountryRegionCode&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp; ,CountryRegionName;&amp;nbsp; &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;SQL SELECT *&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;// data for comparison:&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;from [AdventureWorks2008R2].[Person].[vStateProvinceCountryRegion_STRANGE_DATA];&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;STORE SOURCE_STRANGE_DATA INTO C:\temp\SOURCE_STRANGE_DATA.QVD (qvd);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;QUALIFY *;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&lt;STRONG&gt;UNQUALIFY Autonumbered_Hash;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12pt;"&gt;DELTA:&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&lt;STRONG&gt;RIGHT KEEP &lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt; &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;(-1)* (IsNull(&lt;STRONG&gt;Lookup&lt;/STRONG&gt; ('Autonumbered_Hash', 'Autonumbered_Hash', Autonumbered_Hash, '&lt;STRONG&gt;SOURCE&lt;/STRONG&gt;'))) as&lt;STRONG style="font-size: 12pt;"&gt; Delta_FLAG&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;,*&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;FROM C:\temp\&lt;STRONG&gt;SOURCE_STRANGE_DATA.&lt;/STRONG&gt;QVD (qvd)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;WHERE 1=1&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;//and IsNull(Lookup ('Autonumbered_Hash', 'Autonumbered_Hash', Autonumbered_Hash, 'SOURCE')) &amp;lt;&amp;gt; 0&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 8pt;"&gt;// end script&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets see the results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 619px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="73"&gt;&lt;SPAN style="font-size: 8pt;"&gt;DELTA.&lt;STRONG&gt;Delta_FLAG&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="85"&gt;&lt;SPAN style="font-size: 8pt;"&gt;DELTA.SOURCE_STRANGE_DATA.StateProvinceCode&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="150"&gt;&lt;SPAN style="font-size: 8pt;"&gt;DELTA.SOURCE_STRANGE_DATA.StateProvinceName&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="311"&gt;&lt;SPAN style="font-size: 8pt;"&gt;DELTA.SOURCE_STRANGE_DATA.CountryRegionName&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;NN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;&amp;lt;NEWPROVINCE&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;Canada&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;ON&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;&amp;lt;MISSPELT&amp;gt;Ontario&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG&gt;Canada&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;AB&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Alberta&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;BC&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;British Columbia&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;LB&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Labrador&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;MB&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Manitoba&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;NB&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Brunswick&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;NF&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Newfoundland&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;NS&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Nova Scotia&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;NT&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Northwest Territories&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;PE&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Prince Edward Island&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;SK&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Saskatchewan&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl64" height="17" style="border-top: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;YT&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Yukon Territory&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Canada&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By exposing "Delta_Flag" as a control in QLV, we can identify the modified and new data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is incorrect:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1) Quebec (missing row) is NOT shown and not identified.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Moreover, the right keep removed it from the source.&lt;/P&gt;&lt;P&gt;We need the functional analogue of the FULL OUTER KEEP.&lt;/P&gt;&lt;P&gt;How to reach it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) &lt;STRONG&gt;Duplicate row not shown&lt;/STRONG&gt; (Alberta).&lt;/P&gt;&lt;P&gt;This is easy however, with a separate QVW list box control (expression showing non-distinct count).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="258"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="129"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Alberta&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="129"&gt;&lt;SPAN style="font-size: 8pt;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;British Columbia&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Brunswick&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Labrador&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Manitoba&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Newfoundland&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Northwest Territories&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Nova Scotia&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Prince Edward Island&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Saskatchewan&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;Yukon Territory&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;How to make it (duplicate row) a programmatic flag in script?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)&amp;nbsp; How to make the script smaller and robust (business want to visualize both sources intact separately, and delta separately though).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) Sorry, I do not know how to use &lt;STRONG&gt;LOAD ... KEEP so NOT to affect the previously uploaded table&lt;/STRONG&gt; at all (like full outer keep) in any way, see on example Quebec dissapeared from the source above (using right keep). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left keep would discard the new rows in second (suspect) source though.&lt;/P&gt;&lt;P&gt;We need to keep both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Source: (Quebec was filtered out by right keep):&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="148"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="148"&gt;&lt;EM style="font-size: 8pt;"&gt;Alberta&lt;/EM&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;British Columbia&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;Brunswick&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;Labrador&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;Manitoba&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;Newfoundland&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;Northwest Territories&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;Nova Scotia&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;Prince Edward Island&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;Saskatchewan&lt;/EM&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17"&gt;&lt;P&gt;&lt;EM style="font-size: 8pt;"&gt;Yukon Territory&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody show in detail how to combine left and right keep so not to affect the previously loaded table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you in advance,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Nov 2015 17:49:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Visualize-disparate-Data-from-SQL-Sources/m-p/999809#M643365</guid>
      <dc:creator />
      <dc:date>2015-11-27T17:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize disparate Data from SQL Sources</title>
      <link>https://community.qlik.com/t5/QlikView/Visualize-disparate-Data-from-SQL-Sources/m-p/999810#M643366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might give you an idea how to start (or a possible start):&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/512253"&gt;Re: How to compare 2 tables and put non-matching results?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should handle records existing only in one table (i.e. missing / new in second table) and changed / modified values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure how it handles duplicate rows, but as you said, it should be easy finding these with a list box.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Nov 2015 11:16:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Visualize-disparate-Data-from-SQL-Sources/m-p/999810#M643366</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-11-28T11:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize disparate Data from SQL Sources</title>
      <link>https://community.qlik.com/t5/QlikView/Visualize-disparate-Data-from-SQL-Sources/m-p/999811#M643367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for the reference/code.&lt;/P&gt;&lt;P&gt;I have used this code for comparison of sources.&lt;/P&gt;&lt;P&gt;See Script1 attached for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First we load source (1.1)&amp;nbsp; (trusted data) and suspect data (1.2) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is NO joins between them: &lt;/P&gt;&lt;P&gt;&lt;EM&gt;QUALIFY *;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that we allow the join:&lt;/P&gt;&lt;P&gt;UNQUALIFY *;&lt;/P&gt;&lt;P&gt;and formulate (1.3) the Delta (difference) between sources programmatically:&lt;/P&gt;&lt;P&gt;We allow QVW engine to join by the composite key (i.e. turning the composite key into a surrogate key):&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM&gt;KEY_JOINED&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See this part of the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//(1.3) load Source Formulate the difference between the sources programmatically:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;DELTA&lt;/EM&gt;&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Concatenate (SOURCE) &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;AutoNumberHash256 (StateProvinceID, TerritoryID,StateProvinceName,CountryRegionName) as &lt;STRONG&gt;&lt;EM&gt;Autonumbered_Hash&lt;/EM&gt;&lt;/STRONG&gt;, &lt;/P&gt;&lt;P&gt;AutoNumberHash256 (StateProvinceID, TerritoryID,StateProvinceName,CountryRegionName) as SSD_Autonumbered_Hash,&lt;/P&gt;&lt;P&gt;AutoNumberHash256 (StateProvinceID, TerritoryID) as &lt;STRONG&gt;&lt;EM&gt;KEY_JOINED&lt;/EM&gt;&lt;/STRONG&gt;, &lt;/P&gt;&lt;P&gt;&amp;nbsp; StateProvinceID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,StateProvinceCode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,IsOnlyStateProvinceFlag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,StateProvinceName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,TerritoryID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,CountryRegionCode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,CountryRegionName&lt;/P&gt;&lt;P&gt;,'DELTA' as Table;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;from [AdventureWorks2008R2].[Person].[vStateProvinceCountryRegion_STRANGE_DATA];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;INNER JOIN (SOURCE)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WHERE&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt; "Only in One Table?"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;OR&amp;nbsp; "Hash Different?"&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;OR "Duplicate or Not Match?"&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;KEY_JOINED&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;// (1.4) formulating the 3 data difference scenarios:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,if(count(KEY_JOINED)=1,-1, 0) as "Only in One Table?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,if(maxstring(Autonumbered_Hash)&amp;lt;&amp;gt;minstring(Autonumbered_Hash),-1,0) as "Hash Different?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,if(count(KEY_JOINED) &amp;lt;&amp;gt; 2, -1, 0 ) as "Duplicate or Not Match?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;RESIDENT SOURCE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;GROUP BY KEY_JOINED&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the resulting log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Connecting to UserDSN&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Connected&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SOURCE &amp;lt;&amp;lt; [vStateProvinceCountryRegion] 181 lines fetched&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Connecting to UserDSN_STRANGE_DATA&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Connected&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SOURCE_STRANGE_DATA &amp;lt;&amp;lt; [vStateProvinceCountryRegion_STRANGE_DATA] 182 lines fetched&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SOURCE &amp;lt;&amp;lt; [vStateProvinceCountryRegion_STRANGE_DATA] 363 lines fetched&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DELTA &amp;lt;&amp;lt; SOURCE 4 lines fetched&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;See that only 4 rows populate the Delta recordset.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;See that we exposed the source of each data as a column: &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,'SOURCE' as Table; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;,'DELTA' as Table;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;See the end result: &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;there are 3 analytic flags, we can filter by them:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;We have reached the goal:&lt;/P&gt;&lt;P&gt;identifying all the main scenarios:&lt;/P&gt;&lt;P&gt;1) Missing data (Quebec missing in suspect data)&lt;/P&gt;&lt;P&gt;2) new rows (NewProvince was missing in the source/correct data)&lt;/P&gt;&lt;P&gt;3) Misspelt rows (see Ontario misspelt, actually number of columns might be in hundreds, so it is very simplified example)&lt;/P&gt;&lt;P&gt;4) duplicate rows (see Alberta below)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first column: "table" shows us the source of the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only functional requirement that I did not reach was keeping both sources intact (because I had to concatenate two sources, source data now reduced only to delta/modified data).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to make the script simpler?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 723px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="64"&gt;Table&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="111"&gt;Only in One Table?&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="97"&gt;Hash Different?&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="149"&gt;Duplicate or Not Match?&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="94"&gt;CountryRegionCode&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="79"&gt;CountryRegionName&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="129"&gt;StateProvinceName&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;SOURCE&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Alberta&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;DELTA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Alberta&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;SOURCE&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Ontario&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;DELTA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;&amp;lt;MISSPELT&amp;gt;Ontario&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;SOURCE&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Quebec&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;DELTA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;-1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;CA&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Canada&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;&amp;lt;NEWPROVINCE&amp;gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 22:38:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Visualize-disparate-Data-from-SQL-Sources/m-p/999811#M643367</guid>
      <dc:creator />
      <dc:date>2015-12-14T22:38:55Z</dc:date>
    </item>
  </channel>
</rss>

