<?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: Master Calendar error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520477#M598889</link>
    <description>If you don't mind, would you be able to share why it did not work?</description>
    <pubDate>Thu, 13 Dec 2018 13:58:47 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-12-13T13:58:47Z</dc:date>
    <item>
      <title>Master Calendar error</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520276#M598886</link>
      <description>&lt;P&gt;Hi all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am struggling with the master calendar...&lt;/P&gt;&lt;P&gt;I have implemented the following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;MasterCalendar:&lt;BR /&gt;Load&lt;BR /&gt;TempDate AS DateKey,&lt;BR /&gt;week(TempDate) As Week,&lt;BR /&gt;Year(TempDate) As Year,&lt;BR /&gt;Month(TempDate) As Month,&lt;BR /&gt;Day(TempDate) As Day,&lt;BR /&gt;'Q' &amp;amp; ceil(month(TempDate) / 3) AS Quarter,&lt;BR /&gt;Week(weekstart(TempDate)) &amp;amp; '-' &amp;amp; WeekYear(TempDate) as WeekYear,&lt;BR /&gt;//Date#((Date(monthstart(TempDate), 'YYYYMM')),'YYYYMM') As YearMonth,&lt;BR /&gt;Year(TempDate)&amp;amp;date(TempDate,'MM') As YearMonth,&lt;BR /&gt;Date(MonthStart(TempDate), 'YYYYMM') as YearMonth2,&lt;BR /&gt;// Date(monthstart(TempDate), 'YYYYMMDD') As YearMonth,&lt;BR /&gt;&lt;BR /&gt;WeekDay(TempDate) as WeekDay;&lt;/P&gt;&lt;P&gt;//=== Generate a temp table of dates ===&lt;BR /&gt;LOAD&lt;BR /&gt;date(mindate + IterNo()) AS TempDate&lt;BR /&gt;,maxdate // Used in InYearToDate() above, but not kept&lt;BR /&gt;WHILE mindate + IterNo() &amp;lt;= maxdate;&lt;/P&gt;&lt;P&gt;//=== Get min/max dates from Field ===/&lt;BR /&gt;LOAD&lt;BR /&gt;min(FieldValue('DateKey', recno()))-1 as mindate,&lt;BR /&gt;//'20170101' as mindate,&lt;BR /&gt;max(FieldValue('DateKey', recno())) as maxdate&lt;BR /&gt;// '20180101' as maxdate&lt;BR /&gt;AUTOGENERATE FieldValueCount('DateKey');&lt;/P&gt;&lt;P&gt;but I got the following error message:&lt;/P&gt;&lt;DIV class="headline edc_error"&gt;The following error occurred:&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;Autogenerate: generate count is out of range&lt;/DIV&gt;&lt;DIV class="empty undefined"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="headline edc_error"&gt;The error occurred here:&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;LOAD min(FieldValue('DateKey', recno()))-1 as mindate, max(FieldValue('DateKey', recno())) as maxdate AUTOGENERATE FieldValueCount('DateKey')&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;I was looking for a solution but I was not succesful.&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;Any idea will be much appreciated.&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;Best regards,&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="edc_error"&gt;Edi&lt;/DIV&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:58:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520276#M598886</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2024-11-16T04:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar error</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520388#M598887</link>
      <description>&lt;P&gt;Not sure, but this could be your DateKey field format... I did this... and it worked for me&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;LOAD * INLINE [
    DateKey
    20170101
    20180101
];&lt;/FONT&gt;

MasterCalendar:
LOAD TempDate AS DateKey,
	 week(TempDate) As Week,
	 Year(TempDate) As Year,
	 Month(TempDate) As Month,
	 Day(TempDate) As Day,
	 'Q' &amp;amp; ceil(month(TempDate) / 3) AS Quarter,
	 Week(weekstart(TempDate)) &amp;amp; '-' &amp;amp; WeekYear(TempDate) as WeekYear,
	 //Date#((Date(monthstart(TempDate), 'YYYYMM')),'YYYYMM') As YearMonth,
	 Year(TempDate)&amp;amp;date(TempDate,'MM') As YearMonth,
	 Date(MonthStart(TempDate), 'YYYYMM') as YearMonth2,
	 // Date(monthstart(TempDate), 'YYYYMMDD') As YearMonth,
	 WeekDay(TempDate) as WeekDay;

//=== Generate a temp table of dates ===
LOAD Date(mindate + IterNo()) AS TempDate,
	 maxdate // Used in InYearToDate() above, but not kept
While mindate + IterNo() &amp;lt;= maxdate;

//=== Get min/max dates from Field ===/
LOAD Min(&lt;FONT color="#FF0000"&gt;Date#(&lt;/FONT&gt;FieldValue('DateKey', RecNo())&lt;FONT color="#FF0000"&gt;, 'YYYYMMDD')&lt;/FONT&gt;)-1 as mindate, //'20170101' as mindate,
	 Max(&lt;FONT color="#FF0000"&gt;Date#(&lt;/FONT&gt;FieldValue('DateKey', RecNo())&lt;FONT color="#FF0000"&gt;, 'YYYYMMDD')&lt;/FONT&gt;) as maxdate // '20180101' as maxdate
AutoGenerate FieldValueCount('DateKey');&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Dec 2018 12:23:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520388#M598887</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-13T12:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar error</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520473#M598888</link>
      <description>&lt;P&gt;Hallo Sunny,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already found out why it did not work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for your support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Edi&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 13:56:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520473#M598888</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2018-12-13T13:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar error</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520477#M598889</link>
      <description>If you don't mind, would you be able to share why it did not work?</description>
      <pubDate>Thu, 13 Dec 2018 13:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520477#M598889</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-13T13:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar error</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520482#M598890</link>
      <description>&lt;P&gt;The code I have posted now works (I assume the one you have posted also would work)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My mistake was the order of the script. I had sth like this:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Main&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Calendar&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hierarchy&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Exit Script&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Extract&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Facts&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I thought that since I already ran before the part below "Exit Script" it would works, however&amp;nbsp; to create the Master Calendar the "Fact" part should be place before the "Calendar" part:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Main&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Facts&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Calendar&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hierarchy&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Exit Script&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Extract&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 14:06:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520482#M598890</guid>
      <dc:creator>Zaga_69</dc:creator>
      <dc:date>2018-12-13T14:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar error</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520489#M598891</link>
      <description>Got it and make sense.</description>
      <pubDate>Thu, 13 Dec 2018 14:14:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar-error/m-p/1520489#M598891</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-12-13T14:14:53Z</dc:date>
    </item>
  </channel>
</rss>

