<?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: How to Create a 12 month Flag to Include the Current Month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-Create-a-12-month-Flag-to-Include-the-Current-Month/m-p/29804#M777868</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Emmanuel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the calendar generation, try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15254544235825352 jive_text_macro" jivemacro_uid="_15254544235825352"&gt;
&lt;P&gt;let varMinDate = 40000;&lt;/P&gt;
&lt;P&gt;let varMaxDate = Num(Today());&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Calendar:&lt;/P&gt;
&lt;P&gt;Load &lt;/P&gt;
&lt;P&gt;*,&lt;/P&gt;
&lt;P&gt;if(Num&amp;gt;=Num(MonthStart(AddMonths(Today(),-11))),1,0) as [Flag 12 Months];&lt;/P&gt;
&lt;P&gt;LOAD&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(varMinDate) + Iterno()-1 As Num,&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date($(varMinDate) + IterNo() - 1) as TempDate&lt;/P&gt;
&lt;P&gt;AutoGenerate 1 While $(varMinDate) + IterNo() -1 &amp;lt;= $(varMaxDate);&amp;nbsp; &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will set every date on your calendar based on the current month date.&lt;/P&gt;&lt;P&gt;Thing is you'll have to reprocess the calendar every month, as to include more dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sample.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/201549_sample.png" style="height: 496px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way, only dates that are on the past 12 months will be flaged.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Felipe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2018 17:14:12 GMT</pubDate>
    <dc:creator>felipedl</dc:creator>
    <dc:date>2018-05-04T17:14:12Z</dc:date>
    <item>
      <title>How to Create a 12 month Flag to Include the Current Month</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-Create-a-12-month-Flag-to-Include-the-Current-Month/m-p/29803#M777867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement where I need to create a 12 month flag in my master calendar that would include the current month. I currently have a flag for the previous 12 months, &lt;STRONG&gt;,InMonths(12, D, Today(), -1, num(month(Today()))) as Previous12Months&lt;/STRONG&gt;, however I can't figure out the logic to generate the 12 month flag that includes the current month. This means that I would want to capture the current month with the previous 11.The intent is to use this flag as a filter in on an nPrinting report to automate some biweekly reports. Can anyone lend a hand? Any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Emmanuel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-Create-a-12-month-Flag-to-Include-the-Current-Month/m-p/29803#M777867</guid>
      <dc:creator>ecrobles18</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to Create a 12 month Flag to Include the Current Month</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-Create-a-12-month-Flag-to-Include-the-Current-Month/m-p/29804#M777868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Emmanuel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the calendar generation, try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15254544235825352 jive_text_macro" jivemacro_uid="_15254544235825352"&gt;
&lt;P&gt;let varMinDate = 40000;&lt;/P&gt;
&lt;P&gt;let varMaxDate = Num(Today());&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Calendar:&lt;/P&gt;
&lt;P&gt;Load &lt;/P&gt;
&lt;P&gt;*,&lt;/P&gt;
&lt;P&gt;if(Num&amp;gt;=Num(MonthStart(AddMonths(Today(),-11))),1,0) as [Flag 12 Months];&lt;/P&gt;
&lt;P&gt;LOAD&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(varMinDate) + Iterno()-1 As Num,&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date($(varMinDate) + IterNo() - 1) as TempDate&lt;/P&gt;
&lt;P&gt;AutoGenerate 1 While $(varMinDate) + IterNo() -1 &amp;lt;= $(varMaxDate);&amp;nbsp; &lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will set every date on your calendar based on the current month date.&lt;/P&gt;&lt;P&gt;Thing is you'll have to reprocess the calendar every month, as to include more dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="sample.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/201549_sample.png" style="height: 496px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way, only dates that are on the past 12 months will be flaged.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Felipe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 17:14:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-Create-a-12-month-Flag-to-Include-the-Current-Month/m-p/29804#M777868</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2018-05-04T17:14:12Z</dc:date>
    </item>
  </channel>
</rss>

