<?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 Help? in Visualization and Usability</title>
    <link>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1900371#M201054</link>
    <description>&lt;P&gt;I would suggest this approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MasterCalendar: 
Load 
 TempDate AS OrderDate, 
 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, 
 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(FieldValue('OrderDate', recno()))-1 as mindate,
 max(FieldValue('OrderDate', recno())) as maxdate
AUTOGENERATE FieldValueCount('OrderDate');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This solution comes from Rob Wunderlich, one of the most qlik script expert.&lt;/P&gt;
&lt;P&gt;In below article it explain why this solution is more efficient than others:&lt;A href="https://qlikviewcookbook.com/2015/05/better-calendar-scripts/" target="_self"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://qlikviewcookbook.com/2015/05/better-calendar-scripts/" target="_self"&gt;BETTER CALENDAR SCRIPTS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2022 07:20:56 GMT</pubDate>
    <dc:creator>micheledenardi</dc:creator>
    <dc:date>2022-03-03T07:20:56Z</dc:date>
    <item>
      <title>Master Calendar Help?</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1899589#M201011</link>
      <description>&lt;P&gt;I have two dates - [Transaction Date] and [Posted Date] in the format of XX/XX/XXXX. I am trying to convert these dates to each have date, month, month year, date month year, etc...&lt;/P&gt;
&lt;P&gt;While the below calendar I built works, I do not think it is correct. I need master calendar to show missing dates as well. Is there a better way to write it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LOAD&lt;BR /&gt;Region,&lt;BR /&gt;Company,&lt;BR /&gt;"Report Name",&lt;BR /&gt;"Expense Amount (USD)",&lt;BR /&gt;"Transaction Date",&lt;BR /&gt;"Posted Date";&lt;BR /&gt;FROM .....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Calendar section-----------------------------------------------&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;LET vToday=num(today());&lt;BR /&gt;LET vMinDate=44197;&lt;BR /&gt;LET vMaxDate=num(today());&lt;/P&gt;
&lt;P&gt;// Temporary Table&lt;/P&gt;
&lt;P&gt;TempCal:&lt;BR /&gt;LOAD&lt;BR /&gt;date($(vMinDate) +RowNo()) as TempDate1,&lt;BR /&gt;date($(vMinDate) +RowNo()) as TempDate2&lt;BR /&gt;AutoGenerate&lt;BR /&gt;$(vMaxDate)-$(vMinDate);&lt;/P&gt;
&lt;P&gt;//******************** MASTER CALENDAR**********************&lt;BR /&gt;MasterCalendar:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;LOAD&lt;BR /&gt;TempDate1 as [Posted Date],&lt;/P&gt;
&lt;P&gt;Year(TempDate1) AS [Posted_Year],&lt;BR /&gt;Month(TempDate1) as [Posted_Month],&lt;BR /&gt;day(TempDate1) as [Posted_MDay],&lt;BR /&gt;Week(TempDate1) as [Posted_Week],&lt;BR /&gt;WeekName(TempDate1) as [Posted_WeekName],&lt;BR /&gt;Date(MonthStart(TempDate1),'MM-YYYY') as [Posted_YearMonth],&lt;BR /&gt;//Resident TempCal;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;TempDate2 as [Transaction_Date],&lt;/P&gt;
&lt;P&gt;Year(TempDate2) AS [Transcation_Year],&lt;BR /&gt;Month(TempDate2) as [Transaction_Month],&lt;BR /&gt;day(TempDate2) as [Transaction_MDay],&lt;BR /&gt;Week(TempDate2) as [Transaction_Week],&lt;BR /&gt;WeekName(TempDate2) as [Transaction_WeekName],&lt;BR /&gt;Date(MonthStart(TempDate2),'MM-YYYY') as [Transaction_YearMonth]&lt;BR /&gt;Resident TempCal;&lt;/P&gt;
&lt;P&gt;DROP Table TempCal;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 21:07:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1899589#M201011</guid>
      <dc:creator>wgoudeau</dc:creator>
      <dc:date>2022-03-02T21:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar Help?</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1900371#M201054</link>
      <description>&lt;P&gt;I would suggest this approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MasterCalendar: 
Load 
 TempDate AS OrderDate, 
 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, 
 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(FieldValue('OrderDate', recno()))-1 as mindate,
 max(FieldValue('OrderDate', recno())) as maxdate
AUTOGENERATE FieldValueCount('OrderDate');&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This solution comes from Rob Wunderlich, one of the most qlik script expert.&lt;/P&gt;
&lt;P&gt;In below article it explain why this solution is more efficient than others:&lt;A href="https://qlikviewcookbook.com/2015/05/better-calendar-scripts/" target="_self"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://qlikviewcookbook.com/2015/05/better-calendar-scripts/" target="_self"&gt;BETTER CALENDAR SCRIPTS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 07:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1900371#M201054</guid>
      <dc:creator>micheledenardi</dc:creator>
      <dc:date>2022-03-03T07:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar Help?</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1900642#M201094</link>
      <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;
&lt;P&gt;I have [Posted Date] and [Transaction Date]. I would like to generate month, month year and year for both. I am assuming to use only one date [Posted Date] as my master calendar. Is there a way to convert [Transaction Date] into month, month year and year without adding a second master calendar?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 14:31:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1900642#M201094</guid>
      <dc:creator>wgoudeau</dc:creator>
      <dc:date>2022-03-03T14:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar Help?</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1900956#M201137</link>
      <description>&lt;P&gt;Sure,&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD
Region,
Company,
"Report Name",
"Expense Amount (USD)",
"Posted Date",
"Transaction Date",
year("Transaction Date") as "Transaction Year",
Month("Transaction Date") as "Transaction Month",
Monthname("Transaction Date") as "Transaction Monthname",
num(month("Transaction Date"),'00')&amp;amp;'/'&amp;amp;year("Transaction Date") as "Transaction Period"
FROM .....&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Mar 2022 07:12:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1900956#M201137</guid>
      <dc:creator>micheledenardi</dc:creator>
      <dc:date>2022-03-04T07:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Master Calendar Help?</title>
      <link>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1901935#M201279</link>
      <description>&lt;P&gt;I added Month-Year to the master calendar. Does this look correct to you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MasterCalendar: &lt;BR /&gt;Load &lt;BR /&gt;TempDate AS [Posted Date], &lt;BR /&gt;week(TempDate) As PostedWeek, &lt;BR /&gt;Year(TempDate) As PostedYear, &lt;BR /&gt;Month(TempDate) As PostedMonth, &lt;BR /&gt;Day(TempDate) As PostedDay, &lt;BR /&gt;'Q' &amp;amp; ceil(month(TempDate) / 3) AS PostedQuarter, &lt;BR /&gt;Week(weekstart(TempDate)) &amp;amp; '-' &amp;amp; WeekYear(TempDate) as PostedWeekYear, &lt;BR /&gt;num(Month("TempDate"),'00')&amp;amp;'/'&amp;amp;year("TempDate") as PostedMonthYear,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;//ADDED ABOVE FOR MONTH YEAR&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;WeekDay(TempDate) as PostedWeekDay &lt;BR /&gt;;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 16:40:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Visualization-and-Usability/Master-Calendar-Help/m-p/1901935#M201279</guid>
      <dc:creator>wgoudeau</dc:creator>
      <dc:date>2022-03-07T16:40:58Z</dc:date>
    </item>
  </channel>
</rss>

