<?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: Where Exists Not working in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2043397#M85894</link>
    <description>&lt;P&gt;Your Key field is a combination of the fields RegistrationId__c and RegistrationDate__cm so when doing the "not exists(Key)" filtering, you will make sure that rows will only be loaded into FinalTable if the same combination of RegistrationId__c and RegistrationDate__c in CurrentDay.qvd (i.e. the CurrentDayData table) does not already exist in the PreviousDayData table.&lt;/P&gt;
&lt;P&gt;Does that make sense? Is it what you want to do?&lt;/P&gt;
&lt;P&gt;And last in your script you load data from a qvd named Main__Data.qvd and store that into a qvd named PreviousDay.qvd - and I suppose that is the same qvd that you load at the top in next reload of the app. I don't really know what Main__Data.qvd is and why it is stored as PreviousDay.qvd but to me it seems that this last part of your script has nothing to do with the comparison you say you want to make.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2023 19:58:55 GMT</pubDate>
    <dc:creator>henrikalmen</dc:creator>
    <dc:date>2023-02-28T19:58:55Z</dc:date>
    <item>
      <title>Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042459#M85850</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;I am trying to use Where not exists and it does not seem to be working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My Use case:&lt;/P&gt;
&lt;P&gt;I have a Previous day data and a current file data. I am using a Key field to compare Current day data with Previous day data and load it in the Final table. If There is a change in the key compared to the previous day file the data will get loaded in final table else it wont. Below is my Code :&lt;/P&gt;
&lt;P&gt;PreviousDayData:&lt;BR /&gt;LOAD&lt;BR /&gt;RegistrationId__c,&lt;BR /&gt;RegistrationDate__c,&lt;BR /&gt;RegistrationId__c&amp;amp;RegistrationDate__c as Key&lt;/P&gt;
&lt;P&gt;from&lt;/P&gt;
&lt;P&gt;PreviousDay.qvd (qvd);&lt;/P&gt;
&lt;P&gt;NewRegIDMapping:&lt;BR /&gt;Mapping&lt;BR /&gt;LOAD RegistrationId__c,&lt;BR /&gt;'Old'&lt;BR /&gt;&lt;BR /&gt;Resident PreviousDayData;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CurrentDayData:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD&amp;nbsp;&lt;BR /&gt;RegistrationId__c,&lt;BR /&gt;RegistrationDate__c,&lt;/P&gt;
&lt;P&gt;ApplyMap('NewRegIDMapping',RegistrationId__c,'New') as Flag,&lt;BR /&gt;RegistrationId__c&amp;amp;RegistrationDate__c as Key&lt;/P&gt;
&lt;P&gt;FROM&lt;BR /&gt;Main__Data.qvd (qvd);&lt;/P&gt;
&lt;P&gt;STORE CurrentDayData into CurrentDay.qvd (qvd);&lt;BR /&gt;DROP Table CurrentDayData;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;FinalTable:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD&lt;/P&gt;
&lt;P&gt;RegistrationId__c,&lt;BR /&gt;RegistrationDate__c,&lt;/P&gt;
&lt;P&gt;Flag,&lt;BR /&gt;Key&lt;/P&gt;
&lt;P&gt;From CurrentDay.qvd (qvd)&lt;BR /&gt;Where Not Exists(Key);&lt;BR /&gt;DROP Table PreviousDayData;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;PreviousDayQVD:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD&lt;/P&gt;
&lt;P&gt;RegistrationId__c,&lt;BR /&gt;RegistrationDate__c,&lt;BR /&gt;RegistrationId__c&amp;amp;RegistrationDate__c as Key&lt;BR /&gt;&lt;BR /&gt;From Main__Data.qvd (qvd);&lt;BR /&gt;STORE PreviousDayQVD into PreviousDay.qvd (qvd);&lt;BR /&gt;DROP Table PreviousDayQVD;&lt;/P&gt;
&lt;P&gt;Can you please help? The where not exist does not seem to working now.&lt;/P&gt;
&lt;P&gt;#script #qlikview #syntax&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22245"&gt;@swuehl&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 17:41:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042459#M85850</guid>
      <dc:creator>Rage4444</dc:creator>
      <dc:date>2023-02-27T17:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042618#M85860</link>
      <description>&lt;P&gt;How is it not working? Are you getting zero rows in your last load?&lt;/P&gt;
&lt;P&gt;It seems you missed a part of the load script for the table PreviousDayData in your example above, but I'm thinking that if you don't have a criteria in that part so that everything loads, then all values in the field Key already exists in the data model so there is nothing to load because of "not exists(Key)".&lt;/P&gt;
&lt;P&gt;But maybe that's not the case. What does the load for PreviousDayData actually look like? And what result are you getting, and what result were you expecting?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 14:16:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042618#M85860</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2023-02-27T14:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042707#M85864</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;
&lt;P&gt;I have also updated my code above.&lt;/P&gt;
&lt;P&gt;My Expectation is that I want to compare my current day data with previous day data using this key field and if there is some difference in the date field then load the current day data eg:&lt;/P&gt;
&lt;P&gt;Previous File&lt;/P&gt;
&lt;P&gt;Reg ID&amp;nbsp; &amp;nbsp; &amp;nbsp; Date&lt;/P&gt;
&lt;P&gt;1000&amp;nbsp; &amp;nbsp; &amp;nbsp;10-01-22&lt;/P&gt;
&lt;P&gt;1001&amp;nbsp; &amp;nbsp; &amp;nbsp;10-02-23&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Current File :&lt;/P&gt;
&lt;P&gt;1000&amp;nbsp; &amp;nbsp; &amp;nbsp;10-01-23&lt;/P&gt;
&lt;P&gt;1001&amp;nbsp; &amp;nbsp; &amp;nbsp;10-02-23&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now if you see that the reg ID is updated with the new registration date and hence key field will change. I want to load the record which is in current file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I am getting from this code is that even thought the key field is not changing , the record is still being loaded in the final table. Overall the code should check the current day data and compare it with previous day data and if there is any update in any field in previous day data it should get flagged or then loaded in the final table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 17:42:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042707#M85864</guid>
      <dc:creator>Rage4444</dc:creator>
      <dc:date>2023-02-27T17:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042746#M85865</link>
      <description>&lt;P&gt;The exists()-function only compares the field you give it with the (optional) expression you give it. Your statement "Where Not Exists(Key)" makes sure you load data from CurrentDay.qvd but only rows where the value in the field Key doesn't already exists in the data already loaded into qlik.&lt;/P&gt;
&lt;P&gt;firstTable:&lt;BR /&gt;load * inline [&lt;BR /&gt;Key, Date&lt;BR /&gt;1000, 10-01-22&lt;BR /&gt;1001, 10-02-23&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;secondTable:&lt;BR /&gt;load * inline [&lt;BR /&gt;Key, Date&lt;BR /&gt;1001, 10-01-22&lt;BR /&gt;1002, 10-01-22&lt;BR /&gt;] where not exists(Key);&lt;/P&gt;
&lt;P&gt;In this example, secondTable will contain one row (the row where Key=1002 since that value doesn't already exist in teh Key field. Since all field names are equal in both tables, the row loaded from second table will be automatically inserted into the table firstTable unless you profix the load with "noconcatenate" (but then you would get synthetic keys since two tables have more than one field name in common).&lt;/P&gt;
&lt;P&gt;I'm not sure, perhaps you have misunderstood the exists()-function? Or I have misunderstood you.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 19:17:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042746#M85865</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2023-02-27T19:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042907#M85868</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you try to create a copy of the Key field in&amp;nbsp;&lt;SPAN&gt;PreviousDayData table (Key2) and test against this one in your exist clause (Where Not Exists(Key2))? Then drop this field.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 06:56:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042907#M85868</guid>
      <dc:creator>ckarras22</dc:creator>
      <dc:date>2023-02-28T06:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042912#M85869</link>
      <description>&lt;P&gt;your method should work but dont know why it is not working.&lt;BR /&gt;Try this :&lt;BR /&gt;Current:&lt;BR /&gt;load regID,Date, RegID&amp;amp;Date as Key from source;&lt;BR /&gt;left join&lt;BR /&gt;Previous:&lt;BR /&gt;Load regID&amp;amp;Date as Key,'1' as 1 from source;&lt;BR /&gt;&lt;BR /&gt;Final Table:&lt;BR /&gt;Load RegId,Date resident current where isnull(1);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 07:02:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042912#M85869</guid>
      <dc:creator>Gabbar</dc:creator>
      <dc:date>2023-02-28T07:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042917#M85870</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Try like below&lt;/P&gt;
&lt;P&gt;PreviousDayData:&lt;BR /&gt;LOAD&lt;BR /&gt;RegistrationId__c,&lt;BR /&gt;RegistrationDate__c,&lt;BR /&gt;RegistrationId__c&amp;amp;RegistrationDate__c as Key,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;RegistrationId__c&amp;amp;RegistrationDate__c as Key2&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;from&lt;/P&gt;
&lt;P&gt;PreviousDay.qvd (qvd);&lt;/P&gt;
&lt;P&gt;NewRegIDMapping:&lt;BR /&gt;Mapping&lt;BR /&gt;LOAD RegistrationId__c,&lt;BR /&gt;'Old'&lt;BR /&gt;&lt;BR /&gt;Resident PreviousDayData;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CurrentDayData:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD&amp;nbsp;&lt;BR /&gt;RegistrationId__c,&lt;BR /&gt;RegistrationDate__c,&lt;/P&gt;
&lt;P&gt;ApplyMap('NewRegIDMapping',RegistrationId__c,'New') as Flag,&lt;BR /&gt;RegistrationId__c&amp;amp;RegistrationDate__c as Key&lt;/P&gt;
&lt;P&gt;FROM&lt;BR /&gt;Main__Data.qvd (qvd);&lt;/P&gt;
&lt;P&gt;STORE CurrentDayData into CurrentDay.qvd (qvd);&lt;BR /&gt;DROP Table CurrentDayData;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;FinalTable:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;LOAD&lt;/P&gt;
&lt;P&gt;RegistrationId__c,&lt;BR /&gt;RegistrationDate__c,&lt;/P&gt;
&lt;P&gt;Flag,&lt;BR /&gt;Key&lt;/P&gt;
&lt;P&gt;From CurrentDay.qvd (qvd)&lt;BR /&gt;Where Not Exists(&lt;STRONG&gt;Key2,&amp;nbsp;&lt;/STRONG&gt;Key);&lt;BR /&gt;DROP Table PreviousDayData;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 07:07:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2042917#M85870</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2023-02-28T07:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2043357#M85893</link>
      <description>&lt;P&gt;I tried using the Key2 method the script failed for some reason. It is just crashing and asking me to reload the file from the previous loaded data&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 18:33:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2043357#M85893</guid>
      <dc:creator>Rage4444</dc:creator>
      <dc:date>2023-02-28T18:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2043397#M85894</link>
      <description>&lt;P&gt;Your Key field is a combination of the fields RegistrationId__c and RegistrationDate__cm so when doing the "not exists(Key)" filtering, you will make sure that rows will only be loaded into FinalTable if the same combination of RegistrationId__c and RegistrationDate__c in CurrentDay.qvd (i.e. the CurrentDayData table) does not already exist in the PreviousDayData table.&lt;/P&gt;
&lt;P&gt;Does that make sense? Is it what you want to do?&lt;/P&gt;
&lt;P&gt;And last in your script you load data from a qvd named Main__Data.qvd and store that into a qvd named PreviousDay.qvd - and I suppose that is the same qvd that you load at the top in next reload of the app. I don't really know what Main__Data.qvd is and why it is stored as PreviousDay.qvd but to me it seems that this last part of your script has nothing to do with the comparison you say you want to make.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 19:58:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2043397#M85894</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2023-02-28T19:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2043401#M85895</link>
      <description>&lt;P&gt;Yes that is what I exactly want to do&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/45410"&gt;@henrikalmen&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is some change in key field from Current day file and the previous day file does not contain that key then load that record into the final table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure why the code does not work. Am I doing something wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The last part of the script just makes the current day data to a previous day data post the comparasion is done. The main_data qvd brings the current day data , its like a incremental type of refresh.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to clarify : when the script runs at first the previous day qvd will have yesterday's data and current day will have a live feed data coming from main qvd.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope I was able to explain.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 20:14:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2043401#M85895</guid>
      <dc:creator>Rage4444</dc:creator>
      <dc:date>2023-02-28T20:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2043414#M85896</link>
      <description>&lt;P&gt;Try this for debugging. Just above &lt;FONT face="courier new,courier"&gt;FinalTable:&lt;/FONT&gt; you write: &lt;FONT face="courier new,courier"&gt;qualify *;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;On the line directly after the FinalTable is loaded (before Drop table PreviousDayData) you insert a new line: &lt;FONT face="courier new,courier"&gt;exit script;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Reload the app and check the the data model to see if the tables contains what you think it should. (The "qualify *", if you don't know it already, makes the field names in the foilowing table(s) prefixed with the table name so that there can be no synthetic keys.)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 20:41:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2043414#M85896</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2023-02-28T20:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Where Exists Not working</title>
      <link>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2050642#M86362</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/219733"&gt;@Rage4444&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will be hard to tell what might be wrong from code alone. It is suggested to review:&lt;/P&gt;
&lt;P&gt;The data type/formatting match between the two tables you want to compare.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have dates, make sure you drop time and compare date only if the date is what you want to compare, you can use floor function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also load the data of both sources separately on different apps and show the data in a straight table so it can be verified the formatting match between both and everything looks ok.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other option could be just create demo data, basically one row on each source and verify the comparison is done correctly.&lt;/P&gt;
&lt;P&gt;Hope it helps.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 19:30:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Where-Exists-Not-working/m-p/2050642#M86362</guid>
      <dc:creator>NadiaB</dc:creator>
      <dc:date>2023-03-17T19:30:36Z</dc:date>
    </item>
  </channel>
</rss>

