<?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: If a date is NOT in the current month in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065660#M87412</link>
    <description>&lt;P&gt;Thanks. Even though I was a little incorrect with my own question, this still enabled me to get to the correct answer. However, I misunderstood the business definition. I wonder if you may be able to assist me in tweaking the expression further.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In plain language, I want to:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Return a 1 if today's date is greater than the last stat_date plus the scheduled frequency days.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;I.e. if the last check was 10.04.2022 and the scheduled frequency is 365 days, then it's out of date and should return a 1.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;- However, there is a lead time as to when we receive updates on new status checks (stat_date). As a rule, the business don't want to include any checks that should have been done in the current calendar month, as they may have been completed but not yet recieved.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, the above stat_date for 10.04.2022 &lt;EM&gt;should&lt;/EM&gt; be classed as Out of Date (1), but, as the check may have been completed this month, we may not have had the results yet. As such, I want to class all 'out of date' checks as 'In Date', as the check could have been completed recently - we just haven't had the results. I hope that makes sense. Any help would be gratefully received.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit: in plain language:&lt;/P&gt;
&lt;P&gt;if today's date is greater than the stat date plus the scheduled frequency, and that calculated date&amp;nbsp;&lt;STRONG&gt;not&amp;nbsp;&lt;/STRONG&gt;occurring in the current month, return a 1. Else, return a 0.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2023 09:27:00 GMT</pubDate>
    <dc:creator>Sam_Thomas</dc:creator>
    <dc:date>2023-04-28T09:27:00Z</dc:date>
    <item>
      <title>If a date is NOT in the current month</title>
      <link>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065344#M87379</link>
      <description>&lt;P&gt;I currently have an expression that checks whether a date (Stat_Date) occurred within the last X number of days (based on the Frequency field.&lt;/P&gt;
&lt;P&gt;I need to &lt;STRONG&gt;add&lt;/STRONG&gt; into an expression criteria that asks the question 'is the Stat_Date' later than the last day of the &lt;EM&gt;previous&lt;/EM&gt; month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My current expression:&lt;/P&gt;
&lt;P&gt;num(if(date(today()&amp;gt;([Stat_Date]+[SCHEDULED])), '1', '0')) as [Flag]&lt;/P&gt;
&lt;P&gt;I need to it to &lt;EM&gt;also&lt;/EM&gt; check whether the date is &lt;STRONG&gt;not&lt;/STRONG&gt; in the current month.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 14:54:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065344#M87379</guid>
      <dc:creator>Sam_Thomas</dc:creator>
      <dc:date>2023-04-27T14:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: If a date is NOT in the current month</title>
      <link>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065389#M87386</link>
      <description>&lt;P&gt;maybe like this?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;not InMonth(YourDateToCheck,Today(),0)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 27 Apr 2023 17:20:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065389#M87386</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2023-04-27T17:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: If a date is NOT in the current month</title>
      <link>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065398#M87387</link>
      <description>&lt;P&gt;Try this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;num(if(&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; monthstart(today()) = monthstart([Stat_Date]) and date(today()) &amp;gt; ([Stat_Date] + [SCHEDULED]),&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; '1',&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; monthstart(today()) &amp;lt; monthstart([Stat_Date])&lt;/P&gt;
&lt;P&gt;), '0')) as [Flag]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 17:34:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065398#M87387</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2023-04-27T17:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: If a date is NOT in the current month</title>
      <link>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065660#M87412</link>
      <description>&lt;P&gt;Thanks. Even though I was a little incorrect with my own question, this still enabled me to get to the correct answer. However, I misunderstood the business definition. I wonder if you may be able to assist me in tweaking the expression further.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In plain language, I want to:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Return a 1 if today's date is greater than the last stat_date plus the scheduled frequency days.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;I.e. if the last check was 10.04.2022 and the scheduled frequency is 365 days, then it's out of date and should return a 1.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;- However, there is a lead time as to when we receive updates on new status checks (stat_date). As a rule, the business don't want to include any checks that should have been done in the current calendar month, as they may have been completed but not yet recieved.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, the above stat_date for 10.04.2022 &lt;EM&gt;should&lt;/EM&gt; be classed as Out of Date (1), but, as the check may have been completed this month, we may not have had the results yet. As such, I want to class all 'out of date' checks as 'In Date', as the check could have been completed recently - we just haven't had the results. I hope that makes sense. Any help would be gratefully received.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit: in plain language:&lt;/P&gt;
&lt;P&gt;if today's date is greater than the stat date plus the scheduled frequency, and that calculated date&amp;nbsp;&lt;STRONG&gt;not&amp;nbsp;&lt;/STRONG&gt;occurring in the current month, return a 1. Else, return a 0.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 09:27:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065660#M87412</guid>
      <dc:creator>Sam_Thomas</dc:creator>
      <dc:date>2023-04-28T09:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: If a date is NOT in the current month</title>
      <link>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065879#M87423</link>
      <description>&lt;P&gt;Solved&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;num( if( date(today()&amp;gt;("Stat Date"+"SCHEDULED FREQUENCY")) &lt;BR /&gt;AND (month(today()) &amp;lt;&amp;gt; Month("Stat Date"+"SCHEDULED FREQUENCY")) , 1, 0)) AS [OOD Flag],&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 15:41:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065879#M87423</guid>
      <dc:creator>Sam_Thomas</dc:creator>
      <dc:date>2023-04-28T15:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: If a date is NOT in the current month</title>
      <link>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065979#M87454</link>
      <description>&lt;P&gt;Nice to hear your issue is solved.&lt;/P&gt;
&lt;P&gt;If your expression is working for you, then maybe this one might also:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;-(MonthStart(Today())&amp;gt;[Stat Date]+[SCHEDULED FREQUENCY]) as [OOD Flag]&lt;/LI-CODE&gt;
&lt;P&gt;(If &lt;SPAN&gt;"Stat Date"+"SCHEDULED FREQUENCY" has to be less than Today() and must not be in the current month then it has to be in an earlier month, i.e. before the start of the current month, right?&lt;BR /&gt;&lt;/SPAN&gt;Also using Month() instead of MonthName() in your expression might lead to unexpected results for same months in different years)&lt;/P&gt;
&lt;P&gt;hope this helps&lt;/P&gt;
&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 20:19:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/If-a-date-is-NOT-in-the-current-month/m-p/2065979#M87454</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2023-04-28T20:19:36Z</dc:date>
    </item>
  </channel>
</rss>

