<?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 Not exactly an intervalmatch in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252364#M95675</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot both of you, guys. Very helpful answers those were. I'm also now thinking of creating a little bit easier model related to the above one i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;Emp, StartDate, EndDate&lt;/P&gt;&lt;P&gt;John, 2011-01-31, 2011-02-01&lt;/P&gt;&lt;P&gt;David, 2011-02-08, 2011-02-08&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;P&gt;---------&lt;/P&gt;&lt;P&gt;Emp, CalendarDate&lt;/P&gt;&lt;P&gt;John, 2011-01-31&lt;/P&gt;&lt;P&gt;John, 2011-02-01&lt;/P&gt;&lt;P&gt;David, 2011-02-08&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would you implement the CalendarDate to represent each day from the period?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Przemek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 11 Sep 2011 13:47:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-09-11T13:47:28Z</dc:date>
    <item>
      <title>Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252359#M95670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to relate two tables where one include months the other periods in a way that result shows number of days from a given period that fall into a given month. Intervalmatch on its own doesn't work here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input1&lt;/P&gt;&lt;P&gt;---------&lt;/P&gt;&lt;P&gt;Emp, Month&lt;/P&gt;&lt;P&gt;John, 1&lt;/P&gt;&lt;P&gt;David, 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input2&lt;/P&gt;&lt;P&gt;---------&lt;/P&gt;&lt;P&gt;Emp, StartDate, EndDate&lt;/P&gt;&lt;P&gt;John, 2011-01-08, 2011-01-18&lt;/P&gt;&lt;P&gt;David, 2011-01-28, 2011-02-07&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;P&gt;---------&lt;/P&gt;&lt;P&gt;Emp, Month, EndDate - StartDate&lt;/P&gt;&lt;P&gt;John, 1, 10&lt;/P&gt;&lt;P&gt;David, 1, 3&lt;/P&gt;&lt;P&gt;David, 1, 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Przemek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 10:32:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252359#M95670</guid>
      <dc:creator />
      <dc:date>2011-09-11T10:32:00Z</dc:date>
    </item>
    <item>
      <title>Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252360#M95671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi przemek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you could use interval match if you were using a master calendar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to do that, I think this could calculate the days per month and Emp:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET DateFormat='YYYY-MM-DD';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Emp, StartDate, EndDate&lt;/P&gt;&lt;P&gt;John, 2011-01-08, 2011-01-18&lt;/P&gt;&lt;P&gt;David, 2011-01-28, 2011-02-07&lt;/P&gt;&lt;P&gt;Stefan, 2011-05-03, 2011-09-11&lt;/P&gt;&lt;P&gt;Thomas, 2011-01-01, 2011-12-31&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OUTPUT:&lt;/P&gt;&lt;P&gt;LOAD Emp,&lt;/P&gt;&lt;P&gt;//StartDate, EndDate,&lt;/P&gt;&lt;P&gt;// IterNo(),&lt;/P&gt;&lt;P&gt; if(IterNo()=1,&lt;/P&gt;&lt;P&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(month(EndDate)=month(StartDate), EndDate - StartDate, MonthEnd(StartDate) - StartDate-1),&lt;/P&gt;&lt;P&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(IterNo() = (month(EndDate)-month(StartDate)+1), Day(EndDate),&lt;/P&gt;&lt;P&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Day(MonthEnd(AddMonths(StartDate,IterNo()-1)))))&lt;/P&gt;&lt;P&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as Days,&lt;/P&gt;&lt;P&gt; Month(StartDate) +IterNo()-1 as Month&lt;/P&gt;&lt;P&gt;Resident INPUT while IterNo() &amp;lt;= (month(EndDate)-month(StartDate)+1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you maybe want to restrict the data to INPUT1, but I don't understood how month affected your result table here: In Input1, Month for David is 2 (February?), but then in your result table, David has two entries, both showing Month = 1 where I assumed you only want the second record with Month = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 11:16:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252360#M95671</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-11T11:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252361#M95672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Przemek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was not sure if you were looking for day counts including or excluding the end date, but here is another way (for both)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;EmployeeDates:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOAD * Inline&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;[&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emp, StartDate, EndDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; John, 2011/01/08, 2011/01/18&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; David, 2011/01/28, 2011/02/07&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;//------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;// Build calendar&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;//------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;tmpRange:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOAD Min(StartDate) AS MinStart,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(EndDate) AS MaxEnd&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Resident EmployeeDates;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Let vMinDate = Peek('MinStart');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Let vMaxDate = Peek('MaxEnd');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Drop Table tmpRange;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Calendar:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CalDate,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(CalDate) AS CalMonth,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(CalDate) AS CalYear;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date($(vMinDate) + IterNo() - 1) AS CalDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;AutoGenerate 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;While $(vMinDate) + IterNo() - 1 &amp;lt;= $(vMaxDate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;//------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;// Join date range by employee to the calendar (one calendar per employee)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;//------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Join (Calendar)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOAD Distinct &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emp,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartDate AS Cal.StartDate,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndDate AS Cal.EndDate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Resident EmployeeDates;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;//------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;// EITHER --- Get the day count (exclusive of end date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;//------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Left Join (EmployeeDates)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOAD Emp,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CalMonth AS EmpMonth,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(CalDate) - 1 AS DayCountEx&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Resident Calendar&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Where CalDate &amp;gt;= Cal.StartDate And CalDate &amp;lt;= Cal.EndDate And CalDate &amp;lt; MonthEnd(CalDate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Group By Emp, CalMonth&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;//------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;// OR --- Get the day count (inclusive of end date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;//------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Left Join (EmployeeDates)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;LOAD Emp,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CalMonth AS EmpMonth,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(CalDate) AS DayCountInc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Resident Calendar&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Where CalDate &amp;gt;= Cal.StartDate And CalDate &amp;lt;= Cal.EndDate And CalDate &amp;lt;= MonthEnd(CalDate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Group By Emp, CalMonth&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 11:57:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252361#M95672</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-09-11T11:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252362#M95673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Przemek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Combining Stefan's and my approach, I also came up with a simpler script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;StartEnd:&lt;BR /&gt;LOAD * Inline&lt;BR /&gt;[&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Emp, StartDate, EndDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;John, 2011/01/08, 2011/02/01&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;David, 2011/01/28, 2011/02/07&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;Output:&lt;BR /&gt;LOAD Emp,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Count(DISTINCT CalDate) AS DayCountInc,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Count(DISTINCT CalDate) - 1 AS DayCountEx,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Month(CalDate) AS EmpMonth,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Year(CalDate) AS EmpYear&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Group By Emp, Month(CalDate), Year(CalDate) &lt;BR /&gt;;&lt;BR /&gt;LOAD &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Emp,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Date(StartDate + IterNo() - 1) AS CalDate&lt;BR /&gt;Resident StartEnd&lt;BR /&gt;While StartDate + IterNo() - 1 &amp;lt;= EndDate&lt;BR /&gt;;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;DIV class="mcePaste" id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;"&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Count(DISTINCT CalDate) AS DayCountInc,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 13:13:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252362#M95673</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-09-11T13:13:35Z</dc:date>
    </item>
    <item>
      <title>Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252363#M95674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nice scripting &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed a (possible) problem with your DayCountEx in both scripts: You are removing one day from the count for every month, so if the Emps time period span more than 2 months, the count will be incorrect (and for 2 month they are only correct if you want to exclude start and end date, which don't match the sample result. I assumed from the example results, that one want only the start date to be excluded from the count.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 13:36:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252363#M95674</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-11T13:36:47Z</dc:date>
    </item>
    <item>
      <title>Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252364#M95675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot both of you, guys. Very helpful answers those were. I'm also now thinking of creating a little bit easier model related to the above one i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;Emp, StartDate, EndDate&lt;/P&gt;&lt;P&gt;John, 2011-01-31, 2011-02-01&lt;/P&gt;&lt;P&gt;David, 2011-02-08, 2011-02-08&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;&lt;P&gt;---------&lt;/P&gt;&lt;P&gt;Emp, CalendarDate&lt;/P&gt;&lt;P&gt;John, 2011-01-31&lt;/P&gt;&lt;P&gt;John, 2011-02-01&lt;/P&gt;&lt;P&gt;David, 2011-02-08&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would you implement the CalendarDate to represent each day from the period?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Przemek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 13:47:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252364#M95675</guid>
      <dc:creator />
      <dc:date>2011-09-11T13:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252365#M95676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you want a record for each day of the period (I don't see this in your Result table, but that's how I read your last&amp;nbsp; sentence)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just reuse Jonathans last Load:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(StartDate + IterNo() - 1) AS CalDate&lt;/P&gt;&lt;P&gt;Resident Input&lt;/P&gt;&lt;P&gt;While StartDate + IterNo() - 1 &amp;lt;= EndDate&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Or think about a master calendar and interval match).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bye,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 14:31:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252365#M95676</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-11T14:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252366#M95677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You did not specify that employees could have multiple entries in your original post &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/shocked.png" /&gt;, bur here goes. The main thing is to identify which employee record is being processed, so I add a RowKey field as the first step. Pretty much unchanged after that. The script is now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;StartEnd:&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emp, StartDate, EndDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; John, 2011/01/08, 2011/01/12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; John, 2011/02/04, 2011/02/09&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; John, 2011/02/11, 2011/02/18&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; David, 2011/01/28, 2011/02/07&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (StartEnd)&lt;/P&gt;&lt;P&gt;LOAD *, RowNo() AS RowKey Resident StartEnd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;LOAD Emp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CalDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(CalDate) AS CalMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(CalDate) AS CalYear&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(StartDate + IterNo() - 1) AS CalDate&lt;/P&gt;&lt;P&gt;Resident StartEnd&lt;/P&gt;&lt;P&gt;While StartDate + IterNo() - 1 &amp;lt;= EndDate&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 17:56:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252366#M95677</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-09-11T17:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252367#M95678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;swuehl wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;I noticed a (possible) problem with your DayCountEx in both scripts: You are removing one day from the count for every month, so if the Emps time period span more than 2 months, the count will be incorrect (and for 2 month they are only correct if you want to exclude start and end date, which don't match the sample result. I assumed from the example results, that one want only the start date to be excluded from the count.)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are quite right - I did not test this adequately. I added a check for the month of the CalDate and the month of the EndDate, and only when they are equal then subtract 1 from the count - that fixed the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 18:00:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252367#M95678</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2011-09-11T18:00:08Z</dc:date>
    </item>
    <item>
      <title>Not exactly an intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252368#M95679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've added StartDate and End Date to the final load and it does the same. Anyway, many thanks for the reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Sep 2011 18:34:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Not-exactly-an-intervalmatch/m-p/252368#M95679</guid>
      <dc:creator />
      <dc:date>2011-09-11T18:34:20Z</dc:date>
    </item>
  </channel>
</rss>

