<?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 Comparing dates and using an if statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparing-dates-and-using-an-if-statement/m-p/191070#M53305</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;please provide some data.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Dec 2009 19:29:43 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-17T19:29:43Z</dc:date>
    <item>
      <title>Comparing dates and using an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-dates-and-using-an-if-statement/m-p/191069#M53304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I am trying to compare today's date to see if it falls within our period quarter and if the period quarter is in the past, I want to do another calculation instead. I think that the date comparison is incorrect in my code but I can't figure out what I am doing wrong. So, I have made sure that the date I am comparing is set up as a Date in the format 'YYYYMMDD'&lt;/P&gt;&lt;P&gt;=if(date(today(0),'YYYYMMDD')&amp;lt;[Period Quarter End Date], Calc1,Calc2)&lt;/P&gt;&lt;P&gt;Could you please tell me where I am going wrong?&lt;/P&gt;&lt;P&gt;Thanks, Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 19:22:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-dates-and-using-an-if-statement/m-p/191069#M53304</guid>
      <dc:creator />
      <dc:date>2009-12-17T19:22:05Z</dc:date>
    </item>
    <item>
      <title>Comparing dates and using an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-dates-and-using-an-if-statement/m-p/191070#M53305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;please provide some data.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Rainer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 19:29:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-dates-and-using-an-if-statement/m-p/191070#M53305</guid>
      <dc:creator />
      <dc:date>2009-12-17T19:29:43Z</dc:date>
    </item>
    <item>
      <title>Comparing dates and using an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-dates-and-using-an-if-statement/m-p/191071#M53306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mike,&lt;/P&gt;&lt;P&gt;It should be as simple as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=if(&lt;B&gt;date#(&lt;/B&gt;today(0),'YYYYMMDD'&lt;B&gt;)&lt;/B&gt; &amp;lt; &lt;B&gt;date#(&lt;/B&gt;[Period Quarter End Date],'YYYYMMDD'&lt;B&gt;)&lt;/B&gt;, Calc1, Calc2)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Note the date#() function instead the date() function to force comparing to a timestamp.&lt;/P&gt;&lt;P&gt;But I'd suggest you to use a different function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=if(InQuarter(Today(),date([Period Quarter End Date]),0), Calc1, Calc2)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 19:39:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-dates-and-using-an-if-statement/m-p/191071#M53306</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2009-12-17T19:39:58Z</dc:date>
    </item>
    <item>
      <title>Comparing dates and using an if statement</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-dates-and-using-an-if-statement/m-p/191072#M53307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the help, unfortunately, I cannot use the InQuarter function as we are using our periodic months, not calendar months.&lt;/P&gt;&lt;P&gt;I found out that the data has multiple period end dates so a simple &lt;STRONG&gt;date#(&lt;/STRONG&gt;[Period Quarter End Date],'YYYYMMDD'&lt;STRONG&gt;) produces a null value so I used&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=if(date(today(0),'YYYYMMDD') &amp;lt; date(max({$&amp;lt;[Period Quarter]={'Q1'}&amp;gt;}[Period Quarter End Date]),'YYYYMMDD'), calc1,calc2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hope this helps other people.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mike&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 20:50:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-dates-and-using-an-if-statement/m-p/191072#M53307</guid>
      <dc:creator />
      <dc:date>2009-12-17T20:50:36Z</dc:date>
    </item>
  </channel>
</rss>

