<?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 One Calendar for multiple dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/One-Calendar-for-multiple-dates/m-p/1195177#M385628</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an application that measures the different performance factors throughout the various sectors of our business which we term "metrics".&amp;nbsp; Each one is very different from another, so I've pulled them in with different loads.&amp;nbsp; I have the need to be able to select one fiscal year (Calculated by a central Master Calendar) for all the different "metrics" in my application.&amp;nbsp; Each metric (or table) has a unique date field which works if I make them separate calendars, however I'm at a loss trying to find how to make them work from a single "fiscal year" calendar rather than multiple calendars.&amp;nbsp; Can you tell me how I can create a calendar that allows user to choose the date (fiscal year) only once for all the metrics?&amp;nbsp; The date fields are all named differently at this point in time.&amp;nbsp; I am also enclosing the script that creates the calendars here.&amp;nbsp; You'll note that I sometimes have two calendars (fiscal year (starting month 7) and program year (starting month 4).&amp;nbsp; The metric name is the same value for every table.&amp;nbsp; Do I need to auto generate a unique ID first?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Relational Diagram:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Part of RD for QlikCommunity Post.JPG" class="jive-image image-1" src="/legacyfs/online/139233_Part of RD for QlikCommunity Post.JPG" style="height: 718px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;The script I am using for each metric is the same, as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vFiscalYearStartMonth = 7;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;LET vStartDate = Num(YearStart(Today(), -6));&lt;/P&gt;&lt;P&gt;LET vEndDate = Num(YearEnd(Today()));&lt;/P&gt;&lt;P&gt;TempCalendar:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1)&amp;nbsp; AS OpenDate,&lt;/P&gt;&lt;P&gt;RangeSum(Peek('RowNum'), 1) AS RowNum&lt;/P&gt;&lt;P&gt;AutoGenerate vEndDate - vStartDate + 1;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;CalendarTemp:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;'FS 1.06' as 'FS106_MetricName',&lt;/P&gt;&lt;P&gt;Dual('Q' &amp;amp; Ceil(FiscalMonth/3), Ceil(FiscalMonth/3)) AS FiscalQuarter, // Fiscal Calendar Quarter&lt;/P&gt;&lt;P&gt;Dual(Text(Date(MonthEnd(OpenDate), 'MMM')), FiscalMonth) AS FiscalMonthName; // Fiscal Calendar Month Name&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;Year(OpenDate) AS Year, // Standard Calendar Year&lt;/P&gt;&lt;P&gt;Month(OpenDate) AS Month, // Standard Calendar Month&lt;/P&gt;&lt;P&gt;Date(MonthEnd(OpenDate), 'MMM') AS MonthName,&amp;nbsp; // Standard Calendar Month Name&lt;/P&gt;&lt;P&gt;Dual('Q' &amp;amp; Ceil(Month(OpenDate)/3), Ceil(Month(OpenDate)/3)) AS Quarter,&amp;nbsp; // Standard Calendar Quarter&lt;/P&gt;&lt;P&gt;Mod(Month(OpenDate) - $(vFiscalYearStartMonth), 12)+1 AS FiscalMonth,&amp;nbsp; // Fiscal Calendar Month&lt;/P&gt;&lt;P&gt;YearName(OpenDate, 0, $(vFiscalYearStartMonth)) AS FiscalYear&amp;nbsp; // Fiscal Calendar Year&lt;/P&gt;&lt;P&gt;Resident TempCalendar;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MasterCalendar_FS106_FY:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;FS106_MetricName,&lt;/P&gt;&lt;P&gt;Date(OpenDate) as FS106FY_SVC_OUTCOME_DATE,&lt;/P&gt;&lt;P&gt;RowNum as FS106FY_RowNumber,&lt;/P&gt;&lt;P&gt;Year as FS106FY_CalYear,&lt;/P&gt;&lt;P&gt;Month as FS106FY_CalMonth,&lt;/P&gt;&lt;P&gt;MonthName as FS106FY_CalMonthName,&lt;/P&gt;&lt;P&gt;Quarter as FS106FY_CalQuarter,&lt;/P&gt;&lt;P&gt;FiscalMonth as FS106FY_FiscalMonth,&lt;/P&gt;&lt;P&gt;FiscalYear as FS106FY_FiscalYear,&lt;/P&gt;&lt;P&gt;FiscalQuarter as FS106FY_FiscalQuarter,&lt;/P&gt;&lt;P&gt;FiscalMonthName as FS106FY_FiscalMonthName&lt;/P&gt;&lt;P&gt;Resident CalendarTemp;&lt;/P&gt;&lt;P&gt;DROP TABLE TempCalendar;&lt;/P&gt;&lt;P&gt;DROP TABLE CalendarTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate your help in solving this,&amp;nbsp; Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Sep 2016 00:13:39 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-09-30T00:13:39Z</dc:date>
    <item>
      <title>One Calendar for multiple dates</title>
      <link>https://community.qlik.com/t5/QlikView/One-Calendar-for-multiple-dates/m-p/1195177#M385628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an application that measures the different performance factors throughout the various sectors of our business which we term "metrics".&amp;nbsp; Each one is very different from another, so I've pulled them in with different loads.&amp;nbsp; I have the need to be able to select one fiscal year (Calculated by a central Master Calendar) for all the different "metrics" in my application.&amp;nbsp; Each metric (or table) has a unique date field which works if I make them separate calendars, however I'm at a loss trying to find how to make them work from a single "fiscal year" calendar rather than multiple calendars.&amp;nbsp; Can you tell me how I can create a calendar that allows user to choose the date (fiscal year) only once for all the metrics?&amp;nbsp; The date fields are all named differently at this point in time.&amp;nbsp; I am also enclosing the script that creates the calendars here.&amp;nbsp; You'll note that I sometimes have two calendars (fiscal year (starting month 7) and program year (starting month 4).&amp;nbsp; The metric name is the same value for every table.&amp;nbsp; Do I need to auto generate a unique ID first?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Relational Diagram:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Part of RD for QlikCommunity Post.JPG" class="jive-image image-1" src="/legacyfs/online/139233_Part of RD for QlikCommunity Post.JPG" style="height: 718px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;The script I am using for each metric is the same, as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vFiscalYearStartMonth = 7;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;LET vStartDate = Num(YearStart(Today(), -6));&lt;/P&gt;&lt;P&gt;LET vEndDate = Num(YearEnd(Today()));&lt;/P&gt;&lt;P&gt;TempCalendar:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Date($(vStartDate) + RangeSum(Peek('RowNum'), 1) - 1)&amp;nbsp; AS OpenDate,&lt;/P&gt;&lt;P&gt;RangeSum(Peek('RowNum'), 1) AS RowNum&lt;/P&gt;&lt;P&gt;AutoGenerate vEndDate - vStartDate + 1;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;CalendarTemp:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;'FS 1.06' as 'FS106_MetricName',&lt;/P&gt;&lt;P&gt;Dual('Q' &amp;amp; Ceil(FiscalMonth/3), Ceil(FiscalMonth/3)) AS FiscalQuarter, // Fiscal Calendar Quarter&lt;/P&gt;&lt;P&gt;Dual(Text(Date(MonthEnd(OpenDate), 'MMM')), FiscalMonth) AS FiscalMonthName; // Fiscal Calendar Month Name&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;Year(OpenDate) AS Year, // Standard Calendar Year&lt;/P&gt;&lt;P&gt;Month(OpenDate) AS Month, // Standard Calendar Month&lt;/P&gt;&lt;P&gt;Date(MonthEnd(OpenDate), 'MMM') AS MonthName,&amp;nbsp; // Standard Calendar Month Name&lt;/P&gt;&lt;P&gt;Dual('Q' &amp;amp; Ceil(Month(OpenDate)/3), Ceil(Month(OpenDate)/3)) AS Quarter,&amp;nbsp; // Standard Calendar Quarter&lt;/P&gt;&lt;P&gt;Mod(Month(OpenDate) - $(vFiscalYearStartMonth), 12)+1 AS FiscalMonth,&amp;nbsp; // Fiscal Calendar Month&lt;/P&gt;&lt;P&gt;YearName(OpenDate, 0, $(vFiscalYearStartMonth)) AS FiscalYear&amp;nbsp; // Fiscal Calendar Year&lt;/P&gt;&lt;P&gt;Resident TempCalendar;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MasterCalendar_FS106_FY:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;FS106_MetricName,&lt;/P&gt;&lt;P&gt;Date(OpenDate) as FS106FY_SVC_OUTCOME_DATE,&lt;/P&gt;&lt;P&gt;RowNum as FS106FY_RowNumber,&lt;/P&gt;&lt;P&gt;Year as FS106FY_CalYear,&lt;/P&gt;&lt;P&gt;Month as FS106FY_CalMonth,&lt;/P&gt;&lt;P&gt;MonthName as FS106FY_CalMonthName,&lt;/P&gt;&lt;P&gt;Quarter as FS106FY_CalQuarter,&lt;/P&gt;&lt;P&gt;FiscalMonth as FS106FY_FiscalMonth,&lt;/P&gt;&lt;P&gt;FiscalYear as FS106FY_FiscalYear,&lt;/P&gt;&lt;P&gt;FiscalQuarter as FS106FY_FiscalQuarter,&lt;/P&gt;&lt;P&gt;FiscalMonthName as FS106FY_FiscalMonthName&lt;/P&gt;&lt;P&gt;Resident CalendarTemp;&lt;/P&gt;&lt;P&gt;DROP TABLE TempCalendar;&lt;/P&gt;&lt;P&gt;DROP TABLE CalendarTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would appreciate your help in solving this,&amp;nbsp; Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2016 00:13:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/One-Calendar-for-multiple-dates/m-p/1195177#M385628</guid>
      <dc:creator />
      <dc:date>2016-09-30T00:13:39Z</dc:date>
    </item>
  </channel>
</rss>

