<?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 Expand Date Range into Individual Days in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150336#M28384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having a similar difficulty. In my case, I had to list monthly payments given FROM_MONTH, FROM_YEAR to TO_MONTH, TO_YEAR, as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PAYMENTS:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;SID, FROM_MONTH, FROM_YEAR, TO_MONTH, TO_YEAR&lt;BR /&gt;1, 1, 2009, 3, 2009&lt;BR /&gt;2, 11, 2009, 4, 2010&lt;BR /&gt;]&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Result would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SID, MONTHS_PAID&lt;/P&gt;&lt;P&gt;1,Jan-2009&lt;/P&gt;&lt;P&gt;1,Feb-2009&lt;/P&gt;&lt;P&gt;1,Mar-2009&lt;/P&gt;&lt;P&gt;2,Nov-2009&lt;/P&gt;&lt;P&gt;2,Dec-2009&lt;/P&gt;&lt;P&gt;2,Jan-2010&lt;/P&gt;&lt;P&gt;2,Feb-2010&lt;/P&gt;&lt;P&gt;2,Mar-2010&lt;/P&gt;&lt;P&gt;2,Apr-2010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me pls.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Oct 2010 10:25:50 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-10-06T10:25:50Z</dc:date>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150329#M28377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;My first post on the forums so hopefully the solution to my question isn't too obvious! I have an existing table (VACATION) which is used to track vacation time by employee. The layout is very simple:&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;VACATION:&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;Employee_ID, Vacation_Start, Vacation_End&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 1/28/2009, 2/5/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;What I need to do is create another table (VACATION_DATE) with a row for every day the employee is on vacation. For example if we had an employee (ID #1) with vacation that starts on 1/28/2009 and ends on 2/5/2009 the output would be:&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;VACATION_DATE:&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;Employee_ID, Vacation_Date&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 1/28/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 1/29/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 1/30/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 1/31/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 2/1/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 2/2/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 2/3/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 2/4/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;1, 2/5/2009&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="line-height: normal; margin: 0in 0in 0pt;"&gt;I tried using a For Loop within a Load statement but can't seem to figure out the correct syntax. Any help would be appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2009 03:39:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150329#M28377</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-07-25T03:39:46Z</dc:date>
    </item>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150330#M28378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom:0in;"&gt;I don't have QlikView in front of me at the moment to test, but I believe you need intervalmatch(). I believe that Rob Wunderlich has an example in his cookbook, available at:&lt;/P&gt;&lt;P style="margin-bottom:0in;"&gt;http://robwunderlich.com/downloads/&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2009 04:05:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150330#M28378</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-07-25T04:05:55Z</dc:date>
    </item>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150331#M28379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The IntervalMatch approach is great if you want to link the vacations into a calendar of days, like the entire year. This may be what you want. The QV Cookbook example that John referenced is titled "Fill values in a data range using previous values.",&lt;/P&gt;&lt;P&gt;However, if you want to do exactly what you asked, that is, generate a row for each day only within the actual vacation ranges, then an easier way might be:&lt;/P&gt;&lt;P&gt;Vacation_Days:&lt;BR /&gt;LOAD&lt;BR /&gt; Employee_ID,&lt;BR /&gt; date(Vacation_Start + IterNo() -1) as Vacation_Date&lt;BR /&gt;RESIDENT VACATION&lt;BR /&gt;WHILE Vacation_Start + IterNo() -1 &amp;lt;= Vacation_End&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2009 04:18:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150331#M28379</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-07-25T04:18:55Z</dc:date>
    </item>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150332#M28380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use a LOAD with the WHILE clause and a function IterNo(). For each row in the source table, the logic will be repeated multiple times, as long as (WHILE) the condition is true. IterNo() is the number of the iteration - use it to exit from this loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your LOAD should look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;VACATION_DATE:&lt;BR /&gt;load&lt;BR /&gt; Employee_ID,&lt;BR /&gt; Vacation_Start + IterNo() - 1 as Vacation_Date&lt;BR /&gt;resident&lt;BR /&gt; VACATION&lt;BR /&gt;WHILE&lt;BR /&gt; Vacation_Start + IterNo() - 1 &amp;lt;= Vacation_End&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Oleg&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2009 04:20:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150332#M28380</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-07-25T04:20:17Z</dc:date>
    </item>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150333#M28381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob - this is just funny &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="refHTML"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2009 04:21:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150333#M28381</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2009-07-25T04:21:47Z</dc:date>
    </item>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150334#M28382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the record, here's an IntervalMatch solution that is clearer than the Cookbook example for this dataset.&lt;/P&gt;&lt;P&gt;VACATION:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Employee_ID, Vacation_Start, Vacation_End&lt;BR /&gt;1, 1/28/2009, 2/5/2009&lt;BR /&gt;2, 6/1/2009, 6/15/2009&lt;BR /&gt;]&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;Dates:&lt;BR /&gt;LOAD date(mindate + IterNo() -1) as Vacation_Date&lt;BR /&gt;WHILE mindate + IterNo() -1 &amp;lt;= maxdate&lt;BR /&gt;;&lt;BR /&gt;LOAD min(Vacation_Start) as mindate, max(Vacation_End) as maxdate&lt;BR /&gt;RESIDENT VACATION&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;LEFT JOIN (VACATION) IntervalMatch (Vacation_Date)&lt;BR /&gt; LOAD Vacation_Start, Vacation_End&lt;BR /&gt;RESIDENT VACATION&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;(This will be followed in a few moments by a similar post from Oleg &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2009 04:37:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150334#M28382</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-07-25T04:37:34Z</dc:date>
    </item>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150335#M28383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oleg,&lt;/P&gt;&lt;P&gt;This works great, it seems so simple once you see the solution. I am also experimenting with the other suggested answer to use IntervalMatch. Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2009 04:53:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150335#M28383</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-07-25T04:53:07Z</dc:date>
    </item>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150336#M28384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having a similar difficulty. In my case, I had to list monthly payments given FROM_MONTH, FROM_YEAR to TO_MONTH, TO_YEAR, as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PAYMENTS:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;SID, FROM_MONTH, FROM_YEAR, TO_MONTH, TO_YEAR&lt;BR /&gt;1, 1, 2009, 3, 2009&lt;BR /&gt;2, 11, 2009, 4, 2010&lt;BR /&gt;]&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;Result would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SID, MONTHS_PAID&lt;/P&gt;&lt;P&gt;1,Jan-2009&lt;/P&gt;&lt;P&gt;1,Feb-2009&lt;/P&gt;&lt;P&gt;1,Mar-2009&lt;/P&gt;&lt;P&gt;2,Nov-2009&lt;/P&gt;&lt;P&gt;2,Dec-2009&lt;/P&gt;&lt;P&gt;2,Jan-2010&lt;/P&gt;&lt;P&gt;2,Feb-2010&lt;/P&gt;&lt;P&gt;2,Mar-2010&lt;/P&gt;&lt;P&gt;2,Apr-2010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me pls.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 10:25:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150336#M28384</guid>
      <dc:creator />
      <dc:date>2010-10-06T10:25:50Z</dc:date>
    </item>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150337#M28385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PAYMENTS:&lt;BR /&gt;LOAD SID&lt;BR /&gt;,date(addmonths(makedate(FROM_YEAR,FROM_MONTH),iterno()-1),'MMM-YYYY') as MONTHS_PAID&lt;BR /&gt;INLINE [&lt;BR /&gt;SID, FROM_MONTH, FROM_YEAR, TO_MONTH, TO_YEAR&lt;BR /&gt;1, 1, 2009, 3, 2009&lt;BR /&gt;2, 11, 2009, 4, 2010&lt;BR /&gt;] WHILE iterno() &amp;lt;= (TO_YEAR - FROM_YEAR)*12 + TO_MONTH - FROM_MONTH + 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 18:52:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150337#M28385</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-10-06T18:52:26Z</dc:date>
    </item>
    <item>
      <title>Expand Date Range into Individual Days</title>
      <link>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150338#M28386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Oct 2010 03:54:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expand-Date-Range-into-Individual-Days/m-p/150338#M28386</guid>
      <dc:creator />
      <dc:date>2010-10-07T03:54:09Z</dc:date>
    </item>
  </channel>
</rss>

