<?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 Records in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931271#M643760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, &lt;A href="https://community.qlik.com/qlik-users/96544"&gt;gwassenaar&lt;/A&gt;‌, &lt;A href="https://community.qlik.com/qlik-users/23109"&gt;jagan&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got a requirement which I never worked earlier. I have a total 4 QVW's which are PLD1000, PLD1100, PLD1200 and PLD1300.&lt;/P&gt;&lt;P&gt;PLD1000 is the the parent qvw and rest are children. Due to heavy load of 45 million records in PLD1000, the records has been divided into PLD1100, PLD1200 and PLD1300 as per requirements. Which means sum of record count in PLD1100+PLD1200+PLD1300 = PLD1000. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem here is, we observed that some unwanted records are also getting fetched in children qvw's. The sum of records is not validating. So the task is here, to compare the records in each qvw and if it is not matched the load should fail and should show the reason in the log file as " count of records not matched". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea I am trying to execute is to insert the main table without any transformations in one of the child file with the respective business logic. And I am trying to write IF condition to validate the records and fail the load process if it is not matching and show it in log file. I got struck in writing this condition. Can anyone could please help me out? Any other ideas to achieve this are also appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets assume main table to be inserted as &lt;/P&gt;&lt;P&gt;Main_Data:&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the number of records from this table should match with whole extracted records. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Sorry for a long post. I tried to be brief as much as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Susvith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Dec 2015 15:54:23 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-12-01T15:54:23Z</dc:date>
    <item>
      <title>Compare Records</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931271#M643760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all, &lt;A href="https://community.qlik.com/qlik-users/96544"&gt;gwassenaar&lt;/A&gt;‌, &lt;A href="https://community.qlik.com/qlik-users/23109"&gt;jagan&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got a requirement which I never worked earlier. I have a total 4 QVW's which are PLD1000, PLD1100, PLD1200 and PLD1300.&lt;/P&gt;&lt;P&gt;PLD1000 is the the parent qvw and rest are children. Due to heavy load of 45 million records in PLD1000, the records has been divided into PLD1100, PLD1200 and PLD1300 as per requirements. Which means sum of record count in PLD1100+PLD1200+PLD1300 = PLD1000. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem here is, we observed that some unwanted records are also getting fetched in children qvw's. The sum of records is not validating. So the task is here, to compare the records in each qvw and if it is not matched the load should fail and should show the reason in the log file as " count of records not matched". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea I am trying to execute is to insert the main table without any transformations in one of the child file with the respective business logic. And I am trying to write IF condition to validate the records and fail the load process if it is not matching and show it in log file. I got struck in writing this condition. Can anyone could please help me out? Any other ideas to achieve this are also appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets assume main table to be inserted as &lt;/P&gt;&lt;P&gt;Main_Data:&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the number of records from this table should match with whole extracted records. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: Sorry for a long post. I tried to be brief as much as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Susvith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 15:54:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931271#M643760</guid>
      <dc:creator />
      <dc:date>2015-12-01T15:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Records</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931272#M643761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Get the rows count of the table by using NoOfRows() in the script, and compare if it is not matching then throw and error like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;FROm TableName;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If NoOfRows('&lt;SPAN style="font-size: 13.3333px;"&gt;TableName&lt;/SPAN&gt;') &amp;lt;&amp;gt; SomeNumber THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; TRACE &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;count of records not matched&amp;nbsp;&amp;nbsp; // Trace logs the given text in log file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLE Dummy;&amp;nbsp;&amp;nbsp; // To raise an error we are dropping a table that doesn't exists&lt;/P&gt;&lt;P&gt;END IF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 04:02:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931272#M643761</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-12-03T04:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Records</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931273#M643762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jagan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried working as you said above, but its giving some syntax error.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="58.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/107914_58.png" style="height: 620px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to keep this post more easier at&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/924991"&gt;Condition Reload&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can you please check it for me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;BR /&gt;Susvith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 05:01:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931273#M643762</guid>
      <dc:creator />
      <dc:date>2015-12-03T05:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Records</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931274#M643763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Compare the NoOfRows('TableName') With QvdNoOfRecords('MyFile.qvd')...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 05:10:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931274#M643763</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-12-03T05:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Records</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931275#M643764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had tried writing it.&lt;/P&gt;&lt;P&gt;But I got failed in writing the if condition reload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me in it. For sample files &lt;A href="https://community.qlik.com/message/924991"&gt;Condition Reload&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br&lt;/P&gt;&lt;P&gt;Susvith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 05:14:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931275#M643764</guid>
      <dc:creator />
      <dc:date>2015-12-03T05:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Records</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931276#M643765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp1:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(UnitCost + UnitPrice) as Sum1&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Products.qvd&lt;/P&gt;&lt;P&gt;(qvd);&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;Test:&lt;/P&gt;&lt;P&gt;LOAD CategoryID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pricegroup1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuantityPerUnit, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SupplierID, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitCost, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitPrice, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitsInStock, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitsOnOrder&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Nikhil.xls&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Sheet1$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp2:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(UnitCost + UnitPrice) AS Sum2&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;Nikhil.xls&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Sheet1$);&lt;/P&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;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let TableCount= NoOfRows('Test');&lt;/P&gt;&lt;P&gt;Let QvdCount= QvdNoOfRecords('Products.qvd');&lt;/P&gt;&lt;P&gt;Let vQVDSum= Peek('Sum1', 0, 'Temp1');&lt;/P&gt;&lt;P&gt;Let vExcelSum= Peek('Sum2', 0, 'Temp2');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF TableCount &amp;lt;&amp;gt; QvdCount THEN &lt;/P&gt;&lt;P&gt;&amp;nbsp; TRACE "Records count not matched";&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLE TEst007;&lt;/P&gt;&lt;P&gt;ELSEIF vQVDSum - vExcelSum &amp;gt; 0 THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; TRACE Sum not matched;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DROP TABLE TEst007;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Temp1, Temp2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 05:43:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-Records/m-p/931276#M643765</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-12-03T05:43:12Z</dc:date>
    </item>
  </channel>
</rss>

