<?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: Error on Master Calendar creation. in Featured Members</title>
    <link>https://community.qlik.com/t5/Featured-Members/Error-on-Master-Calendar-creation/m-p/2534399#M431</link>
    <description>&lt;P&gt;Since you are learning you probably want to finish debugging this exercise. But in regards to Master Calendar creation, i want to point out this particular script pattern -- peeking the min/max values into temp variables -- has long been considered a poor practice. Here's why and a much easier pattern&amp;nbsp;&lt;A href="https://qlikviewcookbook.com/2015/05/better-calendar-scripts/" target="_blank"&gt;https://qlikviewcookbook.com/2015/05/better-calendar-scripts/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
    <pubDate>Sat, 25 Oct 2025 19:02:15 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2025-10-25T19:02:15Z</dc:date>
    <item>
      <title>Error on Master Calendar creation.</title>
      <link>https://community.qlik.com/t5/Featured-Members/Error-on-Master-Calendar-creation/m-p/2534320#M429</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I´m trainning with&amp;nbsp;&lt;A href="https://learning.qlik.com/student/path/2628036-data-modeling-with-qlik-cloud-analytics-qlik-sense" target="_blank" rel="noopener"&gt;Data Modeling with Qlik Cloud Analytics / Qlik Sense/Creating the Master Calendar&lt;/A&gt;&lt;/P&gt;&lt;P&gt;in Qlik Learning and i get this error message when i try to create the previous step to Master Calendar Statement.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="avv_0-1761303372957.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/184447iA63C0C05B6B29771/image-size/medium?v=v2&amp;amp;px=400" role="button" title="avv_0-1761303372957.png" alt="avv_0-1761303372957.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can´t find the error, because code is copied from the learning course steps, ¿Could someone tell me where is the error? The full cod section is below:&lt;/P&gt;&lt;P&gt;tFirstAndLastDates:&lt;BR /&gt;LOAD&lt;BR /&gt;Num(Min(FieldValue('OrderDate', RecNo()))) AS MinDate,&lt;BR /&gt;Num(Max(FieldValue('OrderDate', RecNo()))) AS MaxDate&lt;BR /&gt;AUTOGENERATE FieldValueCount('OrderDate');&lt;/P&gt;&lt;P&gt;LET vMinDate = Num(Peek('MinDate', 0, 'tFirstAndLastDates'));&lt;BR /&gt;LET vMaxDate = Num(Peek('MaxDate', 0, 'tFirstAndLastDates'));&lt;BR /&gt;//LET vToday = Peek('maxDate', 0, 'tFirstAndLastDates');&lt;/P&gt;&lt;P&gt;//TRACE vMinDate = $(vMinDate) =&amp;gt; $(=Date($(vMinDate)));&lt;BR /&gt;//TRACE vMaxDate = $(vMaxDate) =&amp;gt; $(=Date($(vMaxDate)));&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;TempCal:&lt;BR /&gt;LOAD&lt;BR /&gt;DATE($(vMinDate) + IterNo() -1) AS TempDate&lt;BR /&gt;RESIDENT tFirstAndLastDates&lt;BR /&gt;WHILE $(vMinDate) + IterNo() - 1 &amp;lt;= $(vMaxDate);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MasterCalendar:&lt;BR /&gt;LOAD *,&lt;BR /&gt;Dual('Q' &amp;amp; Ceil(FiscalMonth/3), Ceil(FiscalMonth/3)) as FiscalQuarter, // Fiscal Calendar Quarter&lt;BR /&gt;Dual(Text(Date(MonthEnd(OrderDate), 'MMM')), FiscalMonth) as FiscalMonthName; // Fiscal Calendar Month Name&lt;BR /&gt;LOAD&lt;BR /&gt;TempDate AS OrderDate, // Model links here to Orders&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;WeekDay(TempDate) AS WeekDay,&lt;BR /&gt;Dual('Q' &amp;amp; Ceil(Month(TempDate) / 3), Ceil(Month(TempDate) / 3)) AS Quarter,&lt;BR /&gt;Date(MonthStart(TempDate),'MMM-YYYY') as MonthYear,&lt;BR /&gt;Week(TempDate) &amp;amp; '-' &amp;amp;&lt;BR /&gt;If(Week(TempDate)=1 AND Month(TempDate)=12,Year(TempDate)+1,&lt;BR /&gt;If(Match(Week(TempDate), 52, 53) AND&lt;BR /&gt;Month(TempDate)=1, Year(TempDate)-1, Year(TempDate))) AS WeekYear,&lt;BR /&gt;InYearToDate(TempDate, $(vToday), 0) * -1 AS CYTDFlag,&lt;BR /&gt;InYearToDate(TempDate, $(vToday), -1) * -1 as LYTDFlag,&lt;BR /&gt;If(DayNumberOfYear(TempDate) &amp;lt;= DayNumberOfYear($(vToday)), 1, 0 ) AS IsInYTD,&lt;BR /&gt;If(DayNumberOfQuarter(TempDate) &amp;lt;= DayNumberOfQuarter($(vToday)), 1, 0) AS IsInQTD,&lt;BR /&gt;If(Day(TempDate) &amp;lt;= Day($(vToday)), 1, 0) AS IsInMTD,&lt;BR /&gt;If(Month(TempDate) = Month($(vToday)), 1, 0) AS IsCurrentMonth,&lt;BR /&gt;If(Month(AddMonths(TempDate,1)) = Month($(vToday)), 1, 0) AS IsLastMonth,&lt;BR /&gt;Mod(Month(TempDate) - $(vFiscalYearStartMonth), 12) + 1 as FiscalMonth, // Fiscal Calendar Month&lt;BR /&gt;YearName(TempDate, 0, $(vFiscalYearStartMonth))as FiscalYear // Fiscal Calendar Year&lt;BR /&gt;&lt;BR /&gt;RESIDENT MasterCalendarTemp;&lt;/P&gt;&lt;P&gt;//DROP TABLE MinMaxTemp;&lt;BR /&gt;//DROP TABLE MasterCalendarTemp;&lt;/P&gt;&lt;P&gt;exit script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN class=""&gt;Creating the Master Calendar&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 10:52:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Featured-Members/Error-on-Master-Calendar-creation/m-p/2534320#M429</guid>
      <dc:creator>avv</dc:creator>
      <dc:date>2025-10-24T10:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error on Master Calendar creation.</title>
      <link>https://community.qlik.com/t5/Featured-Members/Error-on-Master-Calendar-creation/m-p/2534340#M430</link>
      <description>&lt;P&gt;The called variables vMinDate and vMaxDate are not existing. This might be caused if the underlying OrderDate isn't a date else a string which would force the num(min()) to NULL and assigning NULL to a variable deletes it.&lt;/P&gt;&lt;P&gt;Further if an equally table to&amp;nbsp;&lt;SPAN&gt;tFirstAndLastDates is already there this table won't be created else the load-content per auto-concatenate added to the previous table and this results then in NULL for the peek() query.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also any qualifying or ALIAS in beforehand may change the field-names and the peek() results again in NULL.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 13:06:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Featured-Members/Error-on-Master-Calendar-creation/m-p/2534340#M430</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-10-24T13:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error on Master Calendar creation.</title>
      <link>https://community.qlik.com/t5/Featured-Members/Error-on-Master-Calendar-creation/m-p/2534399#M431</link>
      <description>&lt;P&gt;Since you are learning you probably want to finish debugging this exercise. But in regards to Master Calendar creation, i want to point out this particular script pattern -- peeking the min/max values into temp variables -- has long been considered a poor practice. Here's why and a much easier pattern&amp;nbsp;&lt;A href="https://qlikviewcookbook.com/2015/05/better-calendar-scripts/" target="_blank"&gt;https://qlikviewcookbook.com/2015/05/better-calendar-scripts/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;</description>
      <pubDate>Sat, 25 Oct 2025 19:02:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Featured-Members/Error-on-Master-Calendar-creation/m-p/2534399#M431</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2025-10-25T19:02:15Z</dc:date>
    </item>
  </channel>
</rss>

