<?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: Compare dates within same table to set flag in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336747#M835368</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can we bump our own threads?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 May 2017 07:25:32 GMT</pubDate>
    <dc:creator>quilldew</dc:creator>
    <dc:date>2017-05-26T07:25:32Z</dc:date>
    <item>
      <title>Compare dates within same table to set flag</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336744#M835365</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;I have a table that contains records of referrals, with a key &lt;SPAN style="font-size: 13.3333px;"&gt;[Key ClientReferral]&lt;/SPAN&gt; which links to a client table which also contains a [Key Client].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The referral table contains two dates for each &lt;SPAN style="font-size: 13.3333px;"&gt;[Key ClientReferral]&lt;/SPAN&gt;, a [&lt;SPAN style="font-size: 13.3333px;"&gt;ReferralReceivedDate]&lt;/SPAN&gt; and &lt;SPAN style="font-size: 13.3333px;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;ReferralDischargeDate],&lt;/SPAN&gt; and I am trying to find a way to create a flag based on whether a referral for a particular &lt;SPAN style="font-size: 13.3333px;"&gt;[Key Client] has taken place within 30 days of referral discharge.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I have no idea how to go about it seeing as the dates are stored within the same table but will be on different &lt;SPAN style="font-size: 13.3333px;"&gt;[Key ClientReferral] records and I'll need to compare them based on a key in another table.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I'm confusing myself, let me know if you need an example.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336744#M835365</guid>
      <dc:creator>quilldew</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates within same table to set flag</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336745#M835366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daemon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you similar structure of data?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/164734_1.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Andrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 11:11:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336745#M835366</guid>
      <dc:creator>ahaahaaha</dc:creator>
      <dc:date>2017-05-25T11:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates within same table to set flag</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336746#M835367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Andrey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The setup is a bit backwards (I didn't create the table structure).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taking your example, there would be no [Key Client] in Table1 and there would be a [Key ClientReferral] in Table2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have to place the [Key Client] in Table1 I can do though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 May 2017 11:36:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336746#M835367</guid>
      <dc:creator>quilldew</dc:creator>
      <dc:date>2017-05-25T11:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates within same table to set flag</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336747#M835368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can we bump our own threads?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 07:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336747#M835368</guid>
      <dc:creator>quilldew</dc:creator>
      <dc:date>2017-05-26T07:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates within same table to set flag</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336748#M835369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;whether a referral for a particular &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Key Client] has taken place within 30 days of referral discharge&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Are you looking to compare referral dates &lt;SPAN style="text-decoration: underline;"&gt;between&lt;/SPAN&gt; a new referrals and a previous discharge? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 07:39:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336748#M835369</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-05-26T07:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates within same table to set flag</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336749#M835370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I was creating this in Excel I would order the table by [Key Client], ReferralReceivedDate then ReferralDischargeDate and then check each record to the previous record to see if a) the [Key Client] is the same and if so b) the &lt;SPAN style="font-size: 13.3333px;"&gt;ReferralReceivedDate is within 30 days of the &lt;SPAN style="font-size: 13.3333px;"&gt;ReferralDischargeDate on the previous record. I would then set a flag.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I only need to count the days between to know if they are within 30 days of each other, I won't need to store the amount of days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Hope this helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 07:57:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336749#M835370</guid>
      <dc:creator>quilldew</dc:creator>
      <dc:date>2017-05-26T07:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates within same table to set flag</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336750#M835371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's some rough code for that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD [Key Client Referral],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; If(ReferralInterval &amp;lt; 30, 1, 0) as IntervalFlag&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD [Key Client Referral],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; If ([Key Client] = Previous([Key Client]), &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ReferralReceivedDate - Previous(ReferralDischargeDate),&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; 100&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ) as ReferralInterval &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident&amp;nbsp; &amp;lt;&lt;/EM&gt;enter name of table here&lt;EM&gt;&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ORDER BY [Key Client],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ReferralRecivedDate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I am assuming that the dates are normal QV numeric date values.&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 09:14:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336750#M835371</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-05-26T09:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates within same table to set flag</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336751#M835372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if Key Client is not in the same resident table as the referral and the dates, then you can use a mapping like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;MAP_CLIENTS:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Mapping LOAD [Key Client Referral], [Key Client] Resident ...;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD [Key Client Referral],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; If(ReferralInterval &amp;lt; 30, 1, 0) as IntervalFlag&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD [Key Client Referral],&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; If (&lt;STRONG&gt;ApplyMap(MAP_CLIENTS, [Key Client Referral])&lt;/STRONG&gt; =&lt;STRONG&gt; ApplyMap(MAP_CLIENTS, Previous([Key Client Referral])&lt;/STRONG&gt;),&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ReferralRecivedDate - Previous(ReferralDischargeDate),&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; 100&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ) as ReferralInterval &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident&amp;nbsp; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ORDER BY &lt;STRONG&gt;ApplyMap(MAP_CLIENTS, [Key Client Referral])&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp; ReferralRecivedDate&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 09:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336751#M835372</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2017-05-26T09:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Compare dates within same table to set flag</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336752#M835373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first code runs, I haven't checked the results yet but it at least runs after I have left joined my [KEY Client] into the table with the referral dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took the join out for the second piece of code, while trying to work out how it works, but I'm receiving an error as Field not Found but it won't tell me which Field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field not found&lt;/P&gt;&lt;P&gt;LOAD [KEY ClientReferral],&lt;/P&gt;&lt;P&gt;&amp;nbsp; If (ApplyMap(MAP_CLIENTS, [KEY ClientReferral]) = ApplyMap(MAP_CLIENTS, Previous([KEY ClientReferral])),&lt;/P&gt;&lt;P&gt;&amp;nbsp; ReferralReceivedDate - Previous(ReferralDischargeDate),&lt;/P&gt;&lt;P&gt;&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;&amp;nbsp; ) as ReferralInterval&lt;/P&gt;&lt;P&gt;Resident&amp;nbsp; tbl_Referrals&lt;/P&gt;&lt;P&gt;ORDER BY ApplyMap(MAP_CLIENTS, [Key ClientReferral])ReferralReceivedDate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 11:26:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-dates-within-same-table-to-set-flag/m-p/1336752#M835373</guid>
      <dc:creator>quilldew</dc:creator>
      <dc:date>2017-05-26T11:26:56Z</dc:date>
    </item>
  </channel>
</rss>

