<?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 statement with date in Qlik Answers</title>
    <link>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512956#M252</link>
    <description>&lt;P&gt;To answer my own question in case anyone else wants to have a warning about missing data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;this works nicely to warn me of missing data&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;IF(Index(Trim(Concat(DISTINCT Date(Floor([JOB_DATE]), 'DD/MM/YYYY'), ', ')), Date(Today() - Mod(WeekDay(Today()) + 2, 7) - 1, 'DD/MM/YYYY')) &amp;gt; 0, '', 'ALERT *Missing Fridays Data for jobs')&lt;/P&gt;</description>
    <pubDate>Thu, 03 Apr 2025 12:08:01 GMT</pubDate>
    <dc:creator>Jacktheripperz</dc:creator>
    <dc:date>2025-04-03T12:08:01Z</dc:date>
    <item>
      <title>If statement with date</title>
      <link>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512919#M247</link>
      <description>&lt;P&gt;Hi I have a text box that contains the following if statement&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;=if (DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1, 'DD/MM/YYYY') = DATE(MAX(FLOOR([JOB_DATE])), 'DD/MM/YYYY'), '', 'ALERT *Missing Fridays Data for jobs') &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which was supposed to warn for missing data on a friday. but this only works the following day because the max wont be that day so i tried to do it with a count&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;=IF(Count({&amp;lt;JOB_DATE = {"$(=DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1))"}&amp;gt;} JOB_DATE) &amp;gt; 0, '', 'ALERT *Missing Fridays Data for jobs')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;this didnt work because JOB_DATE contains date and time.&lt;BR /&gt;but floor doesnt work in the count so this doesnt work at all &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;=IF(Count({&amp;lt;Date(Floor(JOB_DATE), 'DD/MM/YYYY') = {"$(=DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1))"}&amp;gt;} JOB_DATE) &amp;gt; 0, '', 'ALERT *Missing Fridays Data for jobs')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;does anyone have an idea how to fix this? seems simple but i have run out of solutions&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 10:26:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512919#M247</guid>
      <dc:creator>Jacktheripperz</dc:creator>
      <dc:date>2025-04-03T10:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with date</title>
      <link>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512924#M248</link>
      <description>&lt;P&gt;Max() takes a second, optional parameter for rank. You could use Max(Field,2) to get the second highest value.&lt;/P&gt;&lt;P&gt;I'm also kind of confused about all your assorted date functions which seem cumbersome and unnecessary, but that's not really related to the problem, I guess.&lt;/P&gt;&lt;P&gt;DayName() will return the date without the time aspect (as will Floor()), but the former will treat the field as a date and the latter as a number)&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 10:53:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512924#M248</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2025-04-03T10:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with date</title>
      <link>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512928#M250</link>
      <description>&lt;P&gt;Hi thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;the multiple functions were attempts to get the date I suppose I could make it really cumbersome and have 7&lt;/P&gt;
&lt;P&gt;nested If statements along the lines of&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;=IF(DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1, 'DD/MM/YYYY') = DATE(MAX(FLOOR([JOB_DATE])), 'DD/MM/YYYY'), '', 
IF(DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1, 'DD/MM/YYYY') = DATE(MAX(FLOOR([JOB_DATE]), 2), 'DD/MM/YYYY'), '', 
IF(DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1, 'DD/MM/YYYY') = DATE(MAX(FLOOR([JOB_DATE]), 3), 'DD/MM/YYYY'), '', 
IF(DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1, 'DD/MM/YYYY') = DATE(MAX(FLOOR([JOB_DATE]), 4), 'DD/MM/YYYY'), '', 
IF(DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1, 'DD/MM/YYYY') = DATE(MAX(FLOOR([JOB_DATE]), 5), 'DD/MM/YYYY'), '', 
IF(DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1, 'DD/MM/YYYY') = DATE(MAX(FLOOR([JOB_DATE]), 6), 'DD/MM/YYYY'), '', 
IF(DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1, 'DD/MM/YYYY') = DATE(MAX(FLOOR([JOB_DATE]), 7), 'DD/MM/YYYY'), '', 'ALERT *Missing Fridays Data for jobs')))))))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this seems over complex but would work&amp;nbsp; guess.&amp;nbsp;&lt;BR /&gt;i just think there must be a simple way to compare a date to a date with time column and display a message in there.&lt;BR /&gt;&lt;SPAN&gt;=if (DATE(TODAY() - MOD(WEEKDAY(TODAY()) + 2, 7) - 1, 'DD/MM/YYYY') = DATE(FLOOR([JOB_DATE])), 'DD/MM/YYYY'), '', 'ALERT *Missing Fridays Data for jobs')&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;im guessing this isnt working because it is comparing todays date with a list of dates(array)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I know that I can see 28/03/2025 11:02:22 in the JOB_DATE but if i use this it shows it as a string.&lt;BR /&gt;If( Len(Num(JOB_DATE))=5 , 'Date', 'String')&lt;BR /&gt;but it behaves as a date (and time)&lt;BR /&gt;&lt;BR /&gt;hence im a little lost how to get it to behave &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 11:35:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512928#M250</guid>
      <dc:creator>Jacktheripperz</dc:creator>
      <dc:date>2025-04-03T11:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with date</title>
      <link>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512929#M251</link>
      <description>&lt;P&gt;Your original approach should work (though the Date() wrappers for example are not necessary) if you just fix the Max(), I think?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 11:40:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512929#M251</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2025-04-03T11:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: If statement with date</title>
      <link>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512956#M252</link>
      <description>&lt;P&gt;To answer my own question in case anyone else wants to have a warning about missing data &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;this works nicely to warn me of missing data&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;IF(Index(Trim(Concat(DISTINCT Date(Floor([JOB_DATE]), 'DD/MM/YYYY'), ', ')), Date(Today() - Mod(WeekDay(Today()) + 2, 7) - 1, 'DD/MM/YYYY')) &amp;gt; 0, '', 'ALERT *Missing Fridays Data for jobs')&lt;/P&gt;</description>
      <pubDate>Thu, 03 Apr 2025 12:08:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Answers/If-statement-with-date/m-p/2512956#M252</guid>
      <dc:creator>Jacktheripperz</dc:creator>
      <dc:date>2025-04-03T12:08:01Z</dc:date>
    </item>
  </channel>
</rss>

