<?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: Problem with a Date related Sum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928384#M951741</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do you calculate vDateMaxMonth ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Dec 2015 17:51:42 GMT</pubDate>
    <dc:creator>anlonghi2</dc:creator>
    <dc:date>2015-12-01T17:51:42Z</dc:date>
    <item>
      <title>Problem with a Date related Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928383#M951740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a report which gives Daily and Month to Date sales figures. As we've just gone into December it's thrown up a problem with the a few of the formulas which are based on the number of days in the month. For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;//Month To Date&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;Orders.CalendarMthNo={$(vDateMaxMonth)},Orders.CalendarYr={$(vDateMaxYear)}, Orders.DayOfYear = {'&amp;lt;$(vDateMaxDayOfYear)'}&amp;gt;}distinct order_id)&lt;/P&gt;&lt;/DIV&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;/P&gt;&lt;DIV&gt;//Budget MTD&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({1&amp;lt;Orders.CalendarYr={$(vDateMaxYear)},Orders.CalendarMthNo={$(vDateMaxMonth)}&amp;gt;} ((Budget_Distinct_Order_id/vDateTotalDaysInMonth)*vDateMaxDayOfMonthLessOne))&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the variables being:&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;vDateMaxYear: =max(Orders.CalendarYr)&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;vDateMaxDayOfYear : =DayNumberOfYear(max(order_date))&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;vDateTotalDaysInMonth: =Day(monthend(max(order_date)))&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;vDateMaxDayOfMonthLessOne: =max(order_date)-1&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;These worked fine all month, but this morning they didn't populate and I'm 99% certain it's because of the change in month.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;I'm also pretty certain that if I could figure out how to create a variable that would give me the month for yesterday it should sort out most of the issues, but for some reason it just doesn't seem to like anything I try.&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;Any help would be very gratefully received!&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;&lt;/P&gt;&lt;P style="color: #222222; font-family: arial, sans-serif; font-size: 12.8px;"&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 11:29:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928383#M951740</guid>
      <dc:creator />
      <dc:date>2015-12-01T11:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a Date related Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928384#M951741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how do you calculate vDateMaxMonth ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 17:51:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928384#M951741</guid>
      <dc:creator>anlonghi2</dc:creator>
      <dc:date>2015-12-01T17:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a Date related Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928385#M951742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry - thought I might miss one...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;max({&amp;lt;Orders.CalendarYr={$(vDateMaxYear)}&amp;gt;}Orders.CalnerdarMth)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 08:54:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928385#M951742</guid>
      <dc:creator />
      <dc:date>2015-12-02T08:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a Date related Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928386#M951743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem could be in the formula used to calculate vDateMaxDayOfMonthLessOne because at the beginning of the month&amp;nbsp; max(order_date)-1 return 0 (if order_date is equal to the number of the month day) or the last day of the previous month (if order_date is a valid date) and so the result is a zero or null value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Dec 2015 17:33:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928386#M951743</guid>
      <dc:creator>anlonghi2</dc:creator>
      <dc:date>2015-12-04T17:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a Date related Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928387#M951744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was it - thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 12:23:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928387#M951744</guid>
      <dc:creator />
      <dc:date>2015-12-14T12:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a Date related Sum</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928388#M951747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 13:16:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-a-Date-related-Sum/m-p/928388#M951747</guid>
      <dc:creator>anlonghi2</dc:creator>
      <dc:date>2015-12-14T13:16:40Z</dc:date>
    </item>
  </channel>
</rss>

