<?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 Problem comparing Date to MonthEnd in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154588#M31165</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aldo&lt;/P&gt;&lt;P&gt;can you try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;If&lt;/B&gt;&lt;B&gt;(date([Invoice Date],'DD/MM/YYYY')&lt;/B&gt;&amp;lt;= MonthEnd(Today(), -1))&lt;/P&gt;&lt;P dir="ltr"&gt;Looks like your [Invoice Date] has another formatting?&lt;/P&gt;&lt;P dir="ltr"&gt;Juerg&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 May 2010 12:18:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-05-18T12:18:18Z</dc:date>
    <item>
      <title>Problem comparing Date to MonthEnd</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154587#M31164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;Hi Guys,&lt;/P&gt;&lt;P dir="ltr"&gt;I need help to solve the problem below.&lt;/P&gt;&lt;P dir="ltr"&gt;In a trend chart, I use the expression:&lt;/P&gt;&lt;P dir="ltr"&gt;=$(vSales)&lt;/P&gt;&lt;P dir="ltr"&gt;Where variable is equal to =&lt;B&gt;Sales&lt;/B&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;Sales&lt;/B&gt; is&lt;/P&gt;&lt;P dir="ltr"&gt;Sum(SalesUSD)&lt;/P&gt;&lt;P dir="ltr"&gt;This expression is working ok.&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;Now I need to show only the sales up to last closed month, so I am changing the expression as follows, but it doesn't work. I get "no data".&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;If&lt;/B&gt;&lt;B&gt;(&lt;/B&gt;'29/04/2010'&amp;lt;= MonthEnd(Today(), -1)) &lt;B&gt;It works&lt;/B&gt;.&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;If&lt;/B&gt;&lt;B&gt;(&lt;/B&gt;[Invoice Date]&amp;lt;= MonthEnd(Today(), -1)) &lt;B&gt;It Doesn't work&lt;/B&gt;.&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;If&lt;/B&gt;&lt;B&gt;(&lt;/B&gt;Date([Invoice Date])&amp;lt;= MonthEnd(Today(),-1)) &lt;B&gt;It Doesn't work&lt;/B&gt;.&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;If&lt;/B&gt;&lt;B&gt;(&lt;/B&gt;Date#([Invoice Date])&amp;lt;= MonthEnd(Today(),-1)) &lt;B&gt;It Doesn't work&lt;/B&gt;.&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;When I put the expression:&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;If&lt;/B&gt;&lt;B&gt;(&lt;/B&gt;[Invoice Date]&amp;lt;= MonthEnd(Today(), -1))&lt;/P&gt;&lt;P dir="ltr"&gt;In a table, I get the right answer…&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;What's wrong?&lt;/P&gt;&lt;P dir="ltr"&gt;Thanks in advance,&lt;/P&gt;&lt;P dir="ltr"&gt;Aldo.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 12:00:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154587#M31164</guid>
      <dc:creator />
      <dc:date>2010-05-18T12:00:00Z</dc:date>
    </item>
    <item>
      <title>Problem comparing Date to MonthEnd</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154588#M31165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aldo&lt;/P&gt;&lt;P&gt;can you try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;&lt;B&gt;If&lt;/B&gt;&lt;B&gt;(date([Invoice Date],'DD/MM/YYYY')&lt;/B&gt;&amp;lt;= MonthEnd(Today(), -1))&lt;/P&gt;&lt;P dir="ltr"&gt;Looks like your [Invoice Date] has another formatting?&lt;/P&gt;&lt;P dir="ltr"&gt;Juerg&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 12:18:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154588#M31165</guid>
      <dc:creator />
      <dc:date>2010-05-18T12:18:18Z</dc:date>
    </item>
    <item>
      <title>Problem comparing Date to MonthEnd</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154589#M31166</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 tried&lt;/P&gt;&lt;P&gt;=If(Date([Invoice Date],'DD/MM/YYYY')&amp;lt;= Date(MonthEnd(Today(),-1),'DD/MM/YYYY'), $(vSales))&lt;/P&gt;&lt;P&gt;but is not working...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 12:29:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154589#M31166</guid>
      <dc:creator />
      <dc:date>2010-05-18T12:29:51Z</dc:date>
    </item>
    <item>
      <title>Problem comparing Date to MonthEnd</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154590#M31167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I solved it using Set Analysis:&lt;/P&gt;&lt;P&gt;=Sum({$&amp;lt;[Invoice Date]={'&amp;lt;=$(vLastMonthEnd)'}&amp;gt;}$(vSalesBase))/1000&lt;/P&gt;&lt;P&gt;where the variable vLastMonthEnd stores the last date of last month.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aldo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 14:04:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154590#M31167</guid>
      <dc:creator />
      <dc:date>2010-05-18T14:04:52Z</dc:date>
    </item>
    <item>
      <title>Problem comparing Date to MonthEnd</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154591#M31168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aldo,&lt;/P&gt;&lt;P&gt;Calculations with date demand data formating. Try this:&lt;/P&gt;&lt;P&gt;Inv:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Inv_Date&lt;BR /&gt; 18/05/2010&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;TestDate:&lt;BR /&gt;LOAD&lt;BR /&gt;If(date(Inv_Date,'YYYYMMDD')&amp;lt;= date(MonthEnd(Today()), 'YYYYMMDD') - 1, 'OK') AS Test,&lt;BR /&gt;date(date(MonthEnd(Today()), 'YYYYMMDD') - 1, 'DD/MM/YYYY') as LastDate&lt;BR /&gt;RESIDENT Inv;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 May 2010 15:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154591#M31168</guid>
      <dc:creator />
      <dc:date>2010-05-18T15:06:27Z</dc:date>
    </item>
    <item>
      <title>Problem comparing Date to MonthEnd</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154592#M31169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rubens,&lt;/P&gt;&lt;P&gt;I tried using Date(x, format) and even Date#(Date(x, format))...&lt;/P&gt;&lt;P&gt;It only works with Set Analysis.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aldo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 May 2010 07:34:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154592#M31169</guid>
      <dc:creator />
      <dc:date>2010-05-19T07:34:59Z</dc:date>
    </item>
    <item>
      <title>Problem comparing Date to MonthEnd</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154593#M31170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe I was experiencing the same issue but resolved it using the DayEnd() function.&lt;/P&gt;&lt;P&gt;This works because the MonthEnd() function assigns a time stamp of 23:59:59 so it seemed all other dates did not match. My If statement:&lt;/P&gt;&lt;P&gt;If(IslandDate=MonthEnd(IslandDate),IslandDate) - Does NOT work&lt;/P&gt;&lt;P&gt;If(DayEnd(IslandDate)=MonthEnd(IslandDate),IslandDate) - Does work&lt;/P&gt;&lt;P&gt;Thought I'd post for future reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 14:25:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154593#M31170</guid>
      <dc:creator>nathanfurby</dc:creator>
      <dc:date>2011-03-30T14:25:46Z</dc:date>
    </item>
    <item>
      <title>Problem comparing Date to MonthEnd</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154594#M31171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;Unlike MonthStart, MonthEnd returns a decimal value, a date timestamp corresponding to the last second of the last minute of the last hour of the date, so for today, it will return an underlying numeric value of 40633,9999. Similar happens to DayStart() and DayEnd(). That's why the above works. Well, both actually return a decimal, although in the start funcions is 0.&lt;/P&gt;&lt;P&gt;So Date('31/03/2011') is not equal to MonthEnd('01/03/2011'), because of this. One work around is to get the dates as numbers and use the Floor() function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Floor(MonthEnd('01/03/2011')) = Date('31/03/2011')&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope that makes sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2011 14:42:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154594#M31171</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-03-30T14:42:48Z</dc:date>
    </item>
    <item>
      <title>Problem comparing Date to MonthEnd</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154595#M31172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Miguel - useful info.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2011 10:05:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-comparing-Date-to-MonthEnd/m-p/154595#M31172</guid>
      <dc:creator>nathanfurby</dc:creator>
      <dc:date>2011-04-07T10:05:20Z</dc:date>
    </item>
  </channel>
</rss>

