<?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: Data comparison between dates based on fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1824723#M67738</link>
    <description>&lt;P&gt;If I expect the Agreement to be a unique value for each day I propose the following:&lt;/P&gt;&lt;P&gt;You may do a Left Join of today data to yesterday data using the Agreement as key. Rename today Status as StatusToday before. Compare the columns Status and StatusToday using a If clause which sets the value of StatusToday after the comparison if there was a change into a new column (ie. StatusChange). If there was no yesterday value it should return something different into the new column like "New" for example.&lt;/P&gt;&lt;P&gt;Afterwards you can count the values in StatusChange&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jul 2021 08:17:48 GMT</pubDate>
    <dc:creator>mg_gsi_da</dc:creator>
    <dc:date>2021-07-27T08:17:48Z</dc:date>
    <item>
      <title>Data comparison between dates based on fields</title>
      <link>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1824710#M67734</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I have the below requirement and need your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have data coming in everyday from database. Need to compare today's data with yesterdays data and get the count of existing agreements by comparing status as per below.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp; The count of agreements that exists in data where field “Status” has changed to “Active” (from another status) day on day&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; The count of agreements that exists in data where field “Status” has changed to “Inactive” (from another status) day on day&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; The count of agreements&amp;nbsp;that exists in data where field “Status” has changed to “Monitor” (from another status) day on day&amp;nbsp;&lt;/P&gt;&lt;P&gt;example :&lt;/P&gt;&lt;P&gt;File 1 on 20th&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Agreement&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/07/2021&lt;/TD&gt;&lt;TD&gt;TDC&lt;/TD&gt;&lt;TD&gt;Active&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/07/2021&lt;/TD&gt;&lt;TD&gt;SNCS&lt;/TD&gt;&lt;TD&gt;Inactive&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/07/2021&lt;/TD&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;Active&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/07/2021&lt;/TD&gt;&lt;TD&gt;Test&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Inactive&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;20/07/2021&lt;/TD&gt;&lt;TD&gt;XYZ&lt;/TD&gt;&lt;TD&gt;Active&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;File 2 on 21st&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Agreement&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/07/2021&lt;/TD&gt;&lt;TD&gt;TDC&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Inactive&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/07/2021&lt;/TD&gt;&lt;TD&gt;SNCS&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Active&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/07/2021&lt;/TD&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;Active&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/07/2021&lt;/TD&gt;&lt;TD&gt;Test&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;Monitor&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/07/2021&lt;/TD&gt;&lt;TD&gt;XYZ&lt;/TD&gt;&lt;TD&gt;Active&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/07/2021&lt;/TD&gt;&lt;TD&gt;MNO&lt;/TD&gt;&lt;TD&gt;Active&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OutPut for 21st :&lt;/P&gt;&lt;P&gt;No. of Active : 1&lt;/P&gt;&lt;P&gt;No. of Inactive : 1&lt;/P&gt;&lt;P&gt;No. of Monitor : 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 07:55:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1824710#M67734</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2021-07-27T07:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison between dates based on fields</title>
      <link>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1824723#M67738</link>
      <description>&lt;P&gt;If I expect the Agreement to be a unique value for each day I propose the following:&lt;/P&gt;&lt;P&gt;You may do a Left Join of today data to yesterday data using the Agreement as key. Rename today Status as StatusToday before. Compare the columns Status and StatusToday using a If clause which sets the value of StatusToday after the comparison if there was a change into a new column (ie. StatusChange). If there was no yesterday value it should return something different into the new column like "New" for example.&lt;/P&gt;&lt;P&gt;Afterwards you can count the values in StatusChange&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 08:17:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1824723#M67738</guid>
      <dc:creator>mg_gsi_da</dc:creator>
      <dc:date>2021-07-27T08:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison between dates based on fields</title>
      <link>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1824736#M67742</link>
      <description>&lt;P&gt;Hi Hitha,&lt;/P&gt;&lt;P&gt;I'd try it like this:&lt;/P&gt;&lt;P&gt;tmp:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Date, Agreement, Status&lt;BR /&gt;20/07/2021, TDC, Active&lt;BR /&gt;20/07/2021, SNCS, Inactive&lt;BR /&gt;20/07/2021, ABC, Active&lt;BR /&gt;20/07/2021, Test , Inactive&lt;BR /&gt;20/07/2021, XYZ, Active&lt;BR /&gt;21/07/2021, TDC, Inactive&lt;BR /&gt;21/07/2021, SNCS, Active&lt;BR /&gt;21/07/2021, ABC, Active&lt;BR /&gt;21/07/2021, Test , Monitor&lt;BR /&gt;21/07/2021, XYZ, Active&lt;BR /&gt;21/07/2021, MNO, Active&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;output:&lt;BR /&gt;Load&lt;BR /&gt;Date,&lt;BR /&gt;Agreement,&lt;BR /&gt;Status,&lt;BR /&gt;if(previous(Agreement)=Agreement,previous(Status),NULL()) as prevStatus,&lt;BR /&gt;if(Status=if(previous(Agreement)=Agreement,previous(Status),Status),0,1) as prevStatusCounter&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;resident tmp order by Agreement, Date;&lt;/P&gt;&lt;P&gt;drop table tmp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mruehl_0-1627376717718.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/59191i11E671358513F6B1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mruehl_0-1627376717718.png" alt="mruehl_0-1627376717718.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You have to adjust the expression based on your data model and your date selections!&lt;BR /&gt;I just used sum(prevStatusCounter)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Manuel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 09:07:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1824736#M67742</guid>
      <dc:creator>ManuelRühl</dc:creator>
      <dc:date>2021-07-27T09:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison between dates based on fields</title>
      <link>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1824835#M67756</link>
      <description>&lt;P&gt;Assuming your Date field is recognized as a date, then you could do this without any manipulation to your load script by using set analysis. .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load the data&lt;BR /&gt;&lt;/STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;D&lt;SPAN&gt;atatransactions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Date, Agreement, Status&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;20/07/2021, TDC, Active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;20/07/2021, SNCS, Inactive&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;20/07/2021, ABC, Active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;20/07/2021, Test , Inactive&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;20/07/2021, XYZ, Active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;21/07/2021, TDC, Inactive&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;21/07/2021, SNCS, Active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;21/07/2021, ABC, Active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;21/07/2021, Test , Monitor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;21/07/2021, XYZ, Active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;21/07/2021, MNO, Active&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;];&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create&amp;nbsp; measures/KPIs with these three expressions.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;No of inactive:&lt;BR /&gt;&lt;/STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;count(&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;{&amp;lt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;Date={'$(=maxstring(Date))'},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;Status={'Active'}, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;Agreement = P({&amp;lt;Date={'$(=dayname(maxstring(Date),-1))'},&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;Status-={'Active'}&amp;gt;})&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;gt;}&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;Agreement)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;No of inactive:&lt;BR /&gt;&lt;/STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;count(&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;{&amp;lt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;Date={'$(=maxstring(Date))'},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;Status={'Inactive'}, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;Agreement = P({&amp;lt;Date={'$(=dayname(maxstring(Date),-1))'},&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;Status-={'Inactive'}&amp;gt;})&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;gt;}&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;Agreement)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;No of monitor:&lt;BR /&gt;&lt;/STRONG&gt;&lt;FONT face="courier new,courier" size="2"&gt;count(&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;{&amp;lt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;Date={'$(=maxstring(Date))'},&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;Status={'Monitor'}, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp; &amp;nbsp;Agreement = P({&amp;lt;Date={'$(=dayname(maxstring(Date),-1))'},&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;Status-={'Monitor'}&amp;gt;})&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;gt;}&amp;nbsp;&lt;/FONT&gt;&lt;FONT face="courier new,courier" size="2"&gt;Agreement)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 12:37:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1824835#M67756</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-07-27T12:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison between dates based on fields</title>
      <link>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1825276#M67812</link>
      <description>&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Haven't tried it yet, will try this solution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 19:01:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1825276#M67812</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2021-07-28T19:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison between dates based on fields</title>
      <link>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1825277#M67813</link>
      <description>&lt;P&gt;Thank you, that worked. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 19:02:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1825277#M67813</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2021-07-28T19:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison between dates based on fields</title>
      <link>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1825285#M67814</link>
      <description>&lt;P&gt;Something new to learn. Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 19:27:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Data-comparison-between-dates-based-on-fields/m-p/1825285#M67814</guid>
      <dc:creator>hitha1512</dc:creator>
      <dc:date>2021-07-28T19:27:54Z</dc:date>
    </item>
  </channel>
</rss>

