<?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 days in months in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185342#M49869</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christoph,&lt;/P&gt;&lt;P&gt;It seems that you need to quote the name of the table in the LET statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LET varMinDate = Num(Peek('Fakturadat', 0, 'Sales'));&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope this allows you to run the script properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Nov 2010 10:14:43 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2010-11-17T10:14:43Z</dc:date>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185335#M49862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have already posted this question into another thread, but it does not exactly belong to that topic.&lt;/P&gt;&lt;P&gt;Honestly, I do not know why i cant find a solution therefore in this forum, because I think its a major problem (or im just too stupid to understand that).&lt;/P&gt;&lt;P&gt;When I load my Sales into QV, the invoicedate is the date i am calculating with.&lt;/P&gt;&lt;P&gt;I do have the problem that there are no sales on the last two days of January 2010, so when i select just january, then my MaxOrderDate (=max(Invoicedate)) becomes 29th January.&lt;/P&gt;&lt;P&gt;Within my analysis QV compares January 2010 with January 2009 but only 29 days of January, as a result the sales from 30st and 31st January 2009 are missing.&lt;/P&gt;&lt;P&gt;So i do have to tell QV that January ALWAYS HAS 31 DAYS, February 29 days, march 31 days and so on (always the maximum possible days)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how can i handle this?&lt;/P&gt;&lt;P&gt;Thank you a lot in advance, hope you can give desireable input this weekend so i can finalize my sales analysis next week &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regards, Christoph&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the thread I have already posted is &lt;A href="http://community.qlik.com/forums/p/26358/144044.aspx#144044"&gt;http://community.qlik.com/forums/p/26358/144044.aspx#144044&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 15:20:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185335#M49862</guid>
      <dc:creator />
      <dc:date>2010-11-12T15:20:39Z</dc:date>
    </item>
    <item>
      <title>SV:days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185336#M49863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If you do not already have a "Calendar" table in your app, create one, for example like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Calendar:&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt; OrderDate,&lt;BR /&gt; Year(OrderDate) as Year,&lt;BR /&gt; Month(OrderDate) as Month,&lt;BR /&gt; Date(Monthstart(OrderDate), 'MMM-YYYY') as YearMonth,&lt;BR /&gt; 'Q' &amp;amp; Ceil(Month(OrderDate)/3) as Quarter,&lt;BR /&gt; Dual(Year(OrderDate) &amp;amp; '-Q' &amp;amp; Ceil(Month(OrderDate)/3), Year(OrderDate) &amp;amp; Ceil(Month(OrderDate)/3)) as YearQtr,&lt;BR /&gt; Week(OrderDate) as Week&lt;BR /&gt;RESIDENT OrderHeader;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace &lt;I&gt;&lt;B&gt;OrderHeader&lt;/B&gt;&lt;/I&gt; and &lt;I&gt;&lt;B&gt;OrderDate&lt;/B&gt;&lt;/I&gt; with your sales table name resp. your sales date field name.&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/4382.calendartable.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/4382.calendartable.JPG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you then select Month = January you should get all January-sales regardless of year and day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 15:48:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185336#M49863</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2010-11-12T15:48:21Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185337#M49864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christoph,&lt;/P&gt;&lt;P&gt;If you're comparing a month of the current year with the month of the past year, there is really no need to use the exact date. You should compare them using the January that you exact using the month() function.&lt;/P&gt;&lt;P&gt;Independently, you have to use the function monthend() to make sure QV always considers all the days of the month. Alternatively you can create a master calendar that uses the min and max date of your data and creates creates a table with all dates like the example below.&lt;/P&gt;&lt;P&gt;LET varMinDate = Num(Peek('OrderDate', 0,&lt;BR /&gt;'Orders'));&lt;/P&gt;&lt;P&gt;LET varMaxDate = Num(Peek('OrderDate', -1,&lt;BR /&gt;'Orders'));&lt;/P&gt;&lt;P&gt;LET varToday = num(today());&lt;/P&gt;&lt;P&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;$(varMinDate) + rowno() - 1 AS Num,&lt;BR /&gt;date($(varMinDate) + rowno() - 1) AS&lt;BR /&gt;TempDate&lt;BR /&gt;AUTOGENERATE&lt;BR /&gt;$(varMaxDate) - $(varMinDate) + 1;&lt;/P&gt;&lt;P&gt;//*************** Master Calendar ***************&lt;BR /&gt;MasterCalendar:&lt;BR /&gt;LOAD TempDate AS OrderDate,&lt;BR /&gt;Week(TempDate) AS Week,&lt;BR /&gt;Year(TempDate) AS Year,&lt;BR /&gt;Month(TempDate) AS Month,&lt;BR /&gt;Day(TempDate) AS Day,&lt;BR /&gt;Weekday(TempDate) AS WeekDay,&lt;BR /&gt;'Q' &amp;amp; ceil(month(TempDate) / 3) AS Quarter,&lt;BR /&gt;Date(monthstart(TempDate), 'MMM-YYYY') AS&lt;BR /&gt;MonthYear,&lt;BR /&gt;Week(TempDate)&amp;amp;'-'&amp;amp;Year(TempDate) AS WeekYear,&lt;BR /&gt;inyeartodate(TempDate, $(varToday), 0) * -1 AS&lt;BR /&gt;CurYTDFlag,&lt;BR /&gt;inyeartodate(TempDate, $(varToday), -1) * -1 AS&lt;BR /&gt;LastYTDFlag&lt;BR /&gt;RESIDENT TempCalendar&lt;BR /&gt;ORDER BY TempDate ASC;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 16:00:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185337#M49864</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-11-12T16:00:11Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185338#M49865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Göran, with your solution there is also no Creation (of 31st January for example) of dates included&lt;/P&gt;&lt;P&gt;Karl, I do have to include a calender-solution (which creates every possible day). I am not able to just switch the formula as I also want to compare YTD 24.1.2010 with YTD 24.1.2009 for example.&lt;/P&gt;&lt;P&gt;I just need to teach QV that every Jannuary has 31 days, every February 28 days and so on ..&lt;/P&gt;&lt;P&gt;I would guess your calender-suggestion would do that, but unfortuantely I am not able to include your calender into my Files (maybe i'm still too much novice in QV or too stupid &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&lt;/P&gt;&lt;P&gt;I have adapted your first three lines and then tried to get it to work but either the script has an error or the calender table is not linked to my sales table&lt;/P&gt;&lt;P&gt;Does the calender tab in the script need to be the first tab loaded or the last one?&lt;/P&gt;&lt;P&gt;I have adapted your calender this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LET&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;varMinDate = Num(Peek('Fakturadat', 0,Sales)) &lt;P&gt;;&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;LET&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;varMaxDate = Num(Peek('Fakturadat', -1,Sales)) &lt;P&gt;;&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;LET&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;varToday = num(today()) &lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your effort, Karl!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Christoph&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2010 14:54:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185338#M49865</guid>
      <dc:creator />
      <dc:date>2010-11-15T14:54:59Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185339#M49866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christoph,&lt;/P&gt;&lt;P&gt;You may use MonthEnd() in conjunction with Day function to get dynamically the number of total days per month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=Day(MonthEnd(YourDateField))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;With this, you also save the leap years. But it depends on how you are working with your data, and I'd definitely bet for the master calendar approach.&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2010 18:08:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185339#M49866</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-15T18:08:13Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185340#M49867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Christoph,&lt;/P&gt;&lt;P&gt;Post the exact errors you are seeing and we will help you make the master calendar.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2010 18:51:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185340#M49867</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-11-15T18:51:52Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185341#M49868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion Baeyens, I will keep that in mind but primary go for the calender.&lt;/P&gt;&lt;P&gt;Thanks for your offer Karl, I have included your calender in my script (as the last tab), I adapted the first three "LET ...." and the rest should work automatically, but it doesnt &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So when i load the script the first error I get is:&lt;/P&gt;&lt;P&gt;Fehler in Skriptzeile: (-&amp;gt; Error in script-row)&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt; + rowno() - 1 AS Num,&lt;BR /&gt;date( + rowno() - 1) AS&lt;BR /&gt;TempDate&lt;BR /&gt;AUTOGENERATE&lt;BR /&gt; - + 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then i say okay, then the next error message is:&lt;/P&gt;&lt;P&gt;Tabelle nicht gefunden (-&amp;gt; table not found)&lt;BR /&gt;MasterCalendar:&lt;BR /&gt;LOAD TempDate AS OrderDate,&lt;BR /&gt;Week(TempDate) AS Week,&lt;BR /&gt;Year(TempDate) AS Year,&lt;BR /&gt;Month(TempDate) AS Month,&lt;BR /&gt;Day(TempDate) AS Day,&lt;BR /&gt;Weekday(TempDate) AS WeekDay,&lt;BR /&gt;'Q' &amp;amp; ceil(month(TempDate) / 3) AS Quarter,&lt;BR /&gt;Date(monthstart(TempDate), 'MMM-YYYY') AS&lt;BR /&gt;MonthYear,&lt;BR /&gt;Week(TempDate)&amp;amp;'-'&amp;amp;Year(TempDate) AS WeekYear,&lt;BR /&gt;inyeartodate(TempDate, 40499, 0) * -1 AS&lt;BR /&gt;CurYTDFlag,&lt;BR /&gt;inyeartodate(TempDate, 40499, -1) * -1 AS&lt;BR /&gt;LastYTDFlag&lt;BR /&gt;RESIDENT TempCalendar&lt;BR /&gt;ORDER BY TempDate ASC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 10:05:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185341#M49868</guid>
      <dc:creator />
      <dc:date>2010-11-17T10:05:36Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185342#M49869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christoph,&lt;/P&gt;&lt;P&gt;It seems that you need to quote the name of the table in the LET statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LET varMinDate = Num(Peek('Fakturadat', 0, 'Sales'));&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Hope this allows you to run the script properly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 10:14:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185342#M49869</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-17T10:14:43Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185343#M49870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that was a fast reply! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hm i thought i had tried all different variations (the QV help says that just the fieldname has an ' at start and end), but yes that was the mistake.&lt;/P&gt;&lt;P&gt;Nevertheless my problem is still there, when I choose January, MaxOrderDate becomes 29.1.2010 instead of 31.1.2010&lt;/P&gt;&lt;P&gt;I need anything additionally like makedate or an applymap (map which shows the maximum days of a month), am I right?&lt;/P&gt;&lt;P&gt;Hmmmm &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 10:21:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185343#M49870</guid>
      <dc:creator />
      <dc:date>2010-11-17T10:21:34Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185344#M49871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christoph,&lt;/P&gt;&lt;P&gt;Let's try a different approach, but based on the master calendar table. Just for testing to see whether this returns the right values, create a new text object and use the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;=(Sum({&amp;lt; Year = {2009}, Month = {'jan'} &amp;gt;} Amount) - Sum({&amp;lt; Year = {2010}, Month = {'jan'} &amp;gt;} Amount))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This will take the whole Amount recorded for the month of january 2009 (from the first day of Amount to the last day of Amount) and will substract the corresponding amount for 2010, regardless of the number of days of sales.&lt;/P&gt;&lt;P&gt;If you want to get an average sale amount per day per month, you may use something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum(Amount) / Day(MonthEnd(MakeDate(2010, &lt;B&gt;1&lt;/B&gt;, 1)))&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Instead of the bold "1" you can set a field with the numeric value of the month or a variable with it.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 10:38:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185344#M49871</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-17T10:38:56Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185345#M49872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This doesnt work, it returns Zero&lt;/P&gt;&lt;P&gt;Then i had a look into my Table structure and there is NO connection between MasterCalendar and Fakturadat (my Invoice date field)&lt;/P&gt;&lt;P&gt;shouldnt there be one? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i thought it gets the connection via these lines:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;LET&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;varMinDate = Num(Peek('Fakturadat', 0,'Sales')) &lt;P&gt;;&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;LET&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;varMaxDate = Num(Peek('Fakturadat', -1,'Sales')) &lt;P&gt;;&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;LET&lt;/P&gt;&lt;B&gt;&lt;/B&gt;&lt;P style="font-weight: bold"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;varToday = num(today()) &lt;P&gt;;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 11:37:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185345#M49872</guid>
      <dc:creator />
      <dc:date>2010-11-17T11:37:02Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185346#M49873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christoph,&lt;/P&gt;&lt;P&gt;Of course there must be. From the posts above, I'm figuring you are using this piece of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;MasterCalendar:LOAD TempDate AS OrderDate, // Change this OrderDate to Fackturadat&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;That should link them now, so&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Sum({&amp;lt; Year = {2010} &amp;gt;} Amount)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;(Or the field equivalent to Amount) should return the right figure.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 11:51:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185346#M49873</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-17T11:51:39Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185347#M49874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, connection established! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The amount is right, its the total of January 2010 minus the total of Jan 2009,&lt;/P&gt;&lt;P&gt;but MaxOrderDate still is 29.1.2010 &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 12:05:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185347#M49874</guid>
      <dc:creator />
      <dc:date>2010-11-17T12:05:25Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185348#M49875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;MaxOrderDate is one complete date field (day, month, year), and for me, it seems all right, because that was the last actual day you had sales on january (which also makes sense, January 30 and 31 were saturday and sunday, and likely not working days). In itself it doesn't represent any problem, the problem may come when you want to compare full months to full months on a date.&lt;/P&gt;&lt;P&gt;Then I do not recommend you to use max(field) but to work with the proper dimension in each case. Now that you have a calendar, there's no need to use date-wise comparisons, since you have months, years, weeks... and the proper comparison would be month to month.&lt;/P&gt;&lt;P&gt;Say you want to compare one month to the previous: March has 31 days and February 28 or 29, so date by date you will get an error when March 30 compares to February 30. Month to month will allow you to compare all March to all February, regardless the number of days each month has.&lt;/P&gt;&lt;P&gt;In addition to this, using set analysis will make your expressions easier to understand and to trace, an considerably faster than using any conditional. If you have already used set analysis, you know what I mean.&lt;/P&gt;&lt;P&gt;Hope this makes sense to you.&lt;/P&gt;&lt;P&gt;Do you anyway need that MaxOrderDate for any analysis that cannot be done using set analysis or month to month comparisons?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 12:24:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185348#M49875</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-17T12:24:47Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185349#M49876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My target was to give our executives the possibility to get more information of sales WITHIN a month&lt;/P&gt;&lt;P&gt;but as it seems so difficult to include this option I will do my analysis just on monthly base (like you explained in your post)&lt;/P&gt;&lt;P&gt;Maybe I will try this later on &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I use MaxOrderDate in almost all diagrams and tables to calculate Actual Year, Previous Year and the appropiate budget year&lt;/P&gt;&lt;P&gt;Thank you very much for this detailed explanation, you brought some light into the darkness &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 13:09:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185349#M49876</guid>
      <dc:creator />
      <dc:date>2010-11-17T13:09:27Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185350#M49877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Christoph,&lt;/P&gt;&lt;P&gt;Find attached an example of what I meant in my previous post. I've lodaded the file with some dummy data, and only display one chart that shows, per month, current year and previous year, for each day of the month.&lt;/P&gt;&lt;P&gt;If one day of current year has hadn't any sales, you will see 0, and so with the last year.&lt;/P&gt;&lt;P&gt;Hope it makes easier to understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 14:00:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185350#M49877</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2010-11-17T14:00:54Z</dc:date>
    </item>
    <item>
      <title>days in months</title>
      <link>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185351#M49878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Miguel, I understand what you want to tell me.&lt;/P&gt;&lt;P&gt;But I think I will stick to my MaxOrderDate logic as I always wanna show the actual + previous + budget year considering the users selections.&lt;/P&gt;&lt;P&gt;Furthermore I will concentrate on monthly comparison, in case of emergency (=D) i can show the daily sales (like in your example) and these also in cumulated version.&lt;/P&gt;&lt;P&gt;Thanks for the example, I think thats a general problem that there are such a low number of example-files. Almost all the demo files consist of just the simplest analysis &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 14:35:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/days-in-months/m-p/185351#M49878</guid>
      <dc:creator />
      <dc:date>2010-11-17T14:35:04Z</dc:date>
    </item>
  </channel>
</rss>

