<?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 Day count in Load Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273099#M1180609</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can apply expression as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=DayNumberOfYear(today(),1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here today() returns today's date and 1 shows the start month, so you get the answer &lt;STRONG&gt;337&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Dec 2011 11:18:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-02T11:18:12Z</dc:date>
    <item>
      <title>Day count in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273097#M1180607</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;&lt;/P&gt;&lt;P&gt;I'm trying to create a daily annualization based on today's date vs. 365 days a year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally, I'd like to create in the load script a variable that will auto generate the appropriate factor to multiply today's sales to get me the annualized number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp; today is the 334th day of the calendar year (don't know how to get that 334 number)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use that in the denominator of 365/334 to get the factor to use for today.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to get that 334th day somehow?&amp;nbsp; Something along the lines of what is done in excel using the business day function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 22:14:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273097#M1180607</guid>
      <dc:creator />
      <dc:date>2011-12-01T22:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Day count in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273098#M1180608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe that December 1, 2011 is the 335th day.&amp;nbsp; 31+28+31+30+31+30+31+31+30+31+30+1 = 335, right?&amp;nbsp; Unless you're only counting data through the completion of the previous day, in which case yeah, 334.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd have thought this would work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;daynumberofyear(today())&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it returns 336.&amp;nbsp; Checking the documentation, this function wants to pretend that every year is a leap year, I guess so that December 1 has a consistent number whether or not it is a leap year.&amp;nbsp; So perhaps use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;today() - yearstart(today()) + 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It returns 335.&amp;nbsp; Skip adding the 1 if you want 334.&amp;nbsp; Mind you, I'm not sure which is really better for annualization.&amp;nbsp; After all, December 31, 2012 is day 366, and do you really want 365/366 as your factor?&amp;nbsp; I'd think you'd want 1 at that point.&amp;nbsp; In any case, either December 31, 2012 has a factor less than 1 instead of 1, or March 1, 2011 has a factor of 365/61 instead of 365/60.&amp;nbsp; Decide which "problem" you prefer, I guess.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2011 23:09:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273098#M1180608</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-12-01T23:09:17Z</dc:date>
    </item>
    <item>
      <title>Day count in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273099#M1180609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can apply expression as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=DayNumberOfYear(today(),1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here today() returns today's date and 1 shows the start month, so you get the answer &lt;STRONG&gt;337&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 11:18:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273099#M1180609</guid>
      <dc:creator />
      <dc:date>2011-12-02T11:18:12Z</dc:date>
    </item>
    <item>
      <title>Day count in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273100#M1180610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for this!&amp;nbsp; This worked perfectly.&amp;nbsp; I actually also replaced Today with ReloadTime to get the annualization factor since the last refresh of the model only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 13:43:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273100#M1180610</guid>
      <dc:creator />
      <dc:date>2011-12-02T13:43:55Z</dc:date>
    </item>
    <item>
      <title>Day count in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273101#M1180611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for this as well.&amp;nbsp; Worked great!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Dec 2011 13:44:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Day-count-in-Load-Script/m-p/273101#M1180611</guid>
      <dc:creator />
      <dc:date>2011-12-02T13:44:13Z</dc:date>
    </item>
  </channel>
</rss>

