<?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: using date generator over multiple years in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/using-date-generator-over-multiple-years/m-p/1860015#M1216088</link>
    <description>&lt;P&gt;You need to consider the years, too. Maybe with something like this:&lt;/P&gt;
&lt;P&gt;...&lt;BR /&gt;&lt;SPAN&gt;Monthstart(GanttStart, IterNo()-1) as MonthCounter,&lt;/SPAN&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;SPAN&gt;While&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IterNo() &amp;lt;= (year(GanttEnd) * 12 + Month(GanttEnd)) - (year(GanttStart) * 12 + Month(GanttStart) + 1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Tue, 16 Nov 2021 17:02:26 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2021-11-16T17:02:26Z</dc:date>
    <item>
      <title>using date generator over multiple years</title>
      <link>https://community.qlik.com/t5/QlikView/using-date-generator-over-multiple-years/m-p/1859975#M1216085</link>
      <description>&lt;P&gt;Hi, I have some code (below) which is causing me a headache.&lt;/P&gt;
&lt;P&gt;I have a Gantt Chart that I am pulling together. Each of my projects has a start date (GanttStart) and an end date (GanttEnd). I have written a code loop to add records in the gaps between the start and end date. These are in monthly increments with each project starting on the 1st of the month.&lt;/P&gt;
&lt;P&gt;e.g. a project starts on 01/01/21 and ends 01/12/21 therefore the code will add a data point for 01/02/21, 01/03/21 etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works great - as long as the start and end date are both this year. My issue is that i have some projects starting in January 2021 and ending in November 2022.&lt;/P&gt;
&lt;P&gt;Can someone suggest how i can approach the problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;an extract of my current code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;GANTT_CELLS:&lt;BR /&gt;Load&lt;BR /&gt;GanttId,&lt;BR /&gt;MonthCounter,&lt;BR /&gt;GanttStart,&lt;BR /&gt;GanttEnd,&lt;BR /&gt;Status,&lt;BR /&gt;;&lt;BR /&gt;Load&lt;BR /&gt;Distinct GanttId,&lt;BR /&gt;MakeDate(2021,((Month(GanttStart)-1)+IterNo()),01) as MonthCounter,&lt;BR /&gt;GanttStart,&lt;BR /&gt;GanttEnd,&lt;BR /&gt;1 as Status&lt;BR /&gt;Resident GANTT_Data&lt;BR /&gt;While&lt;BR /&gt;IterNo() &amp;lt;= Month(GanttEnd) - Month(GanttStart) + 1;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 15:34:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-date-generator-over-multiple-years/m-p/1859975#M1216085</guid>
      <dc:creator>chrismtb</dc:creator>
      <dc:date>2021-11-16T15:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: using date generator over multiple years</title>
      <link>https://community.qlik.com/t5/QlikView/using-date-generator-over-multiple-years/m-p/1860015#M1216088</link>
      <description>&lt;P&gt;You need to consider the years, too. Maybe with something like this:&lt;/P&gt;
&lt;P&gt;...&lt;BR /&gt;&lt;SPAN&gt;Monthstart(GanttStart, IterNo()-1) as MonthCounter,&lt;/SPAN&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;SPAN&gt;While&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IterNo() &amp;lt;= (year(GanttEnd) * 12 + Month(GanttEnd)) - (year(GanttStart) * 12 + Month(GanttStart) + 1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 17:02:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-date-generator-over-multiple-years/m-p/1860015#M1216088</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-11-16T17:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: using date generator over multiple years</title>
      <link>https://community.qlik.com/t5/QlikView/using-date-generator-over-multiple-years/m-p/1860328#M1216105</link>
      <description>&lt;P&gt;Thanks Marcus - works like a charm!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 09:27:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-date-generator-over-multiple-years/m-p/1860328#M1216105</guid>
      <dc:creator>chrismtb</dc:creator>
      <dc:date>2021-11-17T09:27:42Z</dc:date>
    </item>
  </channel>
</rss>

