<?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: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400469#M32536</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be use YearToDate function in your calendar script&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/yeartodate.htm" title="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/yeartodate.htm"&gt;yeartodate ‒ QlikView&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/107329"&gt;YTD(Year to date)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Sep 2017 17:19:49 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-09-12T17:19:49Z</dc:date>
    <item>
      <title>Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400466#M32533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Our company has a script that includes an autogenerated calendar that spans between a min and max date. &lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P style="font-size: 13.3333px;"&gt; LOAD&amp;nbsp; &lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp; $(vMinDate) + Iterno()-1 As Num,&amp;nbsp; &lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp; Date($(vMinDate) + IterNo() - 1) as TempDate&amp;nbsp; &lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp; AutoGenerate 1 While $(vMinDate) + IterNo() -1 &amp;lt;= $(vMaxDate);&amp;nbsp; &lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each date is then assigned various calendar dimensions including a flag to indicate which rolling 12 month window in which it belongs.&amp;nbsp; This recreates itself each night during our reload process.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dual(Text(Date("%Date Key",'YYYY-MMM')),Num(MonthStart("%Date Key"))) as "%Year-Month-R12",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Addmonths("%Date Key", -1-(IterNo()-1)) as "%Date Key"&lt;/P&gt;
&lt;P&gt;FROM [$(vQvdSchemaPath)/Periods Dim.qvd] (qvd)&lt;/P&gt;
&lt;P&gt;WHILE IterNo() &amp;lt;= 12;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've noticed that this only works 100% if the current month has 31 days.&amp;nbsp; If the current month does not, such as September, only months with 31 days will have a value populated in "%Year-Month-R12".&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Flag 0.PNG" class="jive-image image-2" src="/legacyfs/online/176281_Flag 0.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I fixed this problem by setting the mode in the AddMonths() function to 1.&amp;nbsp; However, now I am having an issue with values not populating for the 28th day of each month that has 31 days.&amp;nbsp; What am I missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Flag 1.PNG" class="jive-image image-3" src="/legacyfs/online/176282_Flag 1.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 16:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400466#M32533</guid>
      <dc:creator>tleslie</dc:creator>
      <dc:date>2017-09-12T16:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400467#M32534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not use MonthStarts instead of MonthEnds?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dual(Text(Date("%Date Key",'YYYY-MMM')),Num(MonthStart("%Date Key"))) as "%Year-Month-R12",&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;MonthStart&lt;/SPAN&gt;("%Date Key", &lt;SPAN style="color: #ff0000;"&gt;-(IterNo()-1)&lt;/SPAN&gt;) as "%Date Key"&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;FROM [$(vQvdSchemaPath)/Periods Dim.qvd] (qvd)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;WHILE IterNo() &amp;lt;= 12;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 16:56:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400467#M32534</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-09-12T16:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400468#M32535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are assigning a flag to each &lt;STRONG&gt;date&lt;/STRONG&gt;. I tried your code and it only applies to the first day of the month.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 17:08:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400468#M32535</guid>
      <dc:creator>tleslie</dc:creator>
      <dc:date>2017-09-12T17:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400469#M32536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be use YearToDate function in your calendar script&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/yeartodate.htm" title="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/yeartodate.htm"&gt;yeartodate ‒ QlikView&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/107329"&gt;YTD(Year to date)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Sep 2017 17:19:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400469#M32536</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-09-12T17:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400470#M32537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And how exactly would this work in the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 14:02:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400470#M32537</guid>
      <dc:creator>tleslie</dc:creator>
      <dc:date>2017-09-13T14:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400471#M32538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;If( Date - YearStart(Date) &amp;lt;= Today() - YearStart(Today()), 1, 0 ) as IsInYTD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 15:20:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400471#M32538</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-09-13T15:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400472#M32539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, but I do not believe this satisfies our requirements as I have described.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 16:30:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400472#M32539</guid>
      <dc:creator>tleslie</dc:creator>
      <dc:date>2017-09-13T16:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400473#M32540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My bad, for rolling 12 months, you can do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Date &amp;gt;= AddMonths(Today(), -12) and Date &amp;lt;=&amp;nbsp; Today(), 1, 0) as IsRolling12Months&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 16:39:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400473#M32540</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-09-13T16:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400474#M32541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you refer to our existing script, that also does not satisfy our requirements. Thank you for trying.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 18:06:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400474#M32541</guid>
      <dc:creator>tleslie</dc:creator>
      <dc:date>2017-09-14T18:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning a Rolling 12 Month Flag to an AutoGenerated calendar</title>
      <link>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400475#M32542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe I have found a solution to the problem. I decided to concatenate two tables into a temp table, one with Mode 1 and other with Mode 0.&amp;nbsp; I then did a distinct load on the temp table. I now have my desired results, but I am still do not know why using mode 1 would skip over the 28th day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="solution.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/176654_solution.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Sep 2017 18:18:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assigning-a-Rolling-12-Month-Flag-to-an-AutoGenerated-calendar/m-p/1400475#M32542</guid>
      <dc:creator>tleslie</dc:creator>
      <dc:date>2017-09-14T18:18:15Z</dc:date>
    </item>
  </channel>
</rss>

