<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133805#M629406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just follow procedure like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OrdersCalTemp:&lt;/P&gt;&lt;P&gt;Load Min(BILLDATE) as MinOrdDate,&lt;/P&gt;&lt;P&gt;Max(BILLDATE) as MaxOrdDate&lt;/P&gt;&lt;P&gt;Resident FACTTABLE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let EndDate=Date(Peek('MaxOrdDate',0,'OrdersCalTemp'),'$(DateFormat)');&lt;/P&gt;&lt;P&gt;let StartDate=Date(Peek('MinOrdDate',0,'OrdersCalTemp'),'$(DateFormat)');&lt;/P&gt;&lt;P&gt;let caldays=(EndDate-StartDate)+1;&lt;/P&gt;&lt;P&gt;let vToday=num(EndDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cal:&lt;/P&gt;&lt;P&gt;Load RecNo() as RecordNo,&lt;/P&gt;&lt;P&gt;if(RecNo()=1,Date('$(StartDate)'),Date(peek("D")+1)) as D&lt;/P&gt;&lt;P&gt;autogenerate(caldays);&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;BILLDATE,&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;Resident Cal;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jul 2016 09:27:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-07-25T09:27:00Z</dc:date>
    <item>
      <title>Master Calendar</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133803#M629404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have two tables (Qlik Sense 3.0), with dates, one with historical dates and one with forecast dates.&amp;nbsp; They both start and end at different points in time.&amp;nbsp; My query is... (apologies for my ignorance, this is my first go at this) can the one master calendar look at a min date from the historical data and max date from the forecast data?&amp;nbsp; Or do I need two different calendars or some other solution?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Monica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 02:03:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133803#M629404</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-25T02:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133804#M629405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's possible. Best to give the date field in both tables the same name so they will both be linked to the master calendar. After loading both tables you can generate a master calendar using the date field that now contains all the historical and forecast dates. Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(min(FieldValue('MyDate', RecNo())) as MinDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(max(FieldValue('MyDate', RecNo())) as MaxDate,&lt;/P&gt;&lt;P&gt;AUTOGENERATE FieldValueCount('MyDate') ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMinDate = peek('MinDate');&lt;/P&gt;&lt;P&gt;Let vMaxDate = peek('MaxDate');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MasterCalendar:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year(Date) as Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month(Date) as Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...etc...&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date($(vMinDate) + RecNo() -1) as MyDate&lt;/P&gt;&lt;P&gt;AUTOGENERATE $(vMaxDate) - $(vMinDate) + 1 ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 08:09:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133804#M629405</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-07-25T08:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133805#M629406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just follow procedure like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OrdersCalTemp:&lt;/P&gt;&lt;P&gt;Load Min(BILLDATE) as MinOrdDate,&lt;/P&gt;&lt;P&gt;Max(BILLDATE) as MaxOrdDate&lt;/P&gt;&lt;P&gt;Resident FACTTABLE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let EndDate=Date(Peek('MaxOrdDate',0,'OrdersCalTemp'),'$(DateFormat)');&lt;/P&gt;&lt;P&gt;let StartDate=Date(Peek('MinOrdDate',0,'OrdersCalTemp'),'$(DateFormat)');&lt;/P&gt;&lt;P&gt;let caldays=(EndDate-StartDate)+1;&lt;/P&gt;&lt;P&gt;let vToday=num(EndDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cal:&lt;/P&gt;&lt;P&gt;Load RecNo() as RecordNo,&lt;/P&gt;&lt;P&gt;if(RecNo()=1,Date('$(StartDate)'),Date(peek("D")+1)) as D&lt;/P&gt;&lt;P&gt;autogenerate(caldays);&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;BILLDATE,&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;Resident Cal;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2016 09:27:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133805#M629406</guid>
      <dc:creator />
      <dc:date>2016-07-25T09:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133806#M629407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&amp;nbsp; So, do I mention the two tables in the master calendar script? eg Do I need to load two different temp tables to load the two date fields from the two tables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 01:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133806#M629407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-26T01:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar</title>
      <link>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133807#M629408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, like I said first load the two main tables so all date values from those two tables exist in the in-memory database. Rename the date fields if necessary so there's only one date field name in the final data model. Then create the master calendar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2016 07:09:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Master-Calendar/m-p/1133807#M629408</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-07-26T07:09:27Z</dc:date>
    </item>
  </channel>
</rss>

