<?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: Canonical &amp;amp; Master Calendars for 2 Tables with Date fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Canonical-amp-Master-Calendars-for-2-Tables-with-Date-fields/m-p/2514619#M105543</link>
    <description>&lt;P&gt;Hi Robin,&lt;/P&gt;&lt;P&gt;The only issue I see in your script is that your date in the date bridge table is called&amp;nbsp;&lt;SPAN&gt;Canonical_Date, while the Master Calendar has the field Date, so if this is your script verbatim, then nothing should link, and no expression should work right.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Other than that, I'd need to see your expressions to understand what's not working right.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Apr 2025 13:29:45 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2025-04-16T13:29:45Z</dc:date>
    <item>
      <title>Canonical &amp; Master Calendars for 2 Tables with Date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Canonical-amp-Master-Calendars-for-2-Tables-with-Date-fields/m-p/2514582#M105538</link>
      <description>&lt;P&gt;l created a Canonical &amp;amp; Master Calendar l was sure would work but apparently it only worked for 1 table i.e. i created a bar graph and one expression worked and for the second table it failed to calculate correctly or slice the data by month. If anyone has a code which works where its joining date fields from two different tables please kindly share your syntax. Mine is below and maybe you can pick my errors&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;DateBridge:&lt;BR /&gt;Load&lt;BR /&gt;[Posting_Date] as Flag_Date,&lt;BR /&gt;[Material],&lt;BR /&gt;[Posting_Date] as Canonical_Date,&lt;BR /&gt;'Inventories' as DateType&lt;BR /&gt;Resident [Inventories];&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt;[Date] as Flag_Date,&lt;BR /&gt;[Material],&lt;BR /&gt;[Date] as Canonical_Date,&lt;BR /&gt;'Materials_usage' as DateType&lt;BR /&gt;Resident [Materials_usage];&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;// Master Calendar aligned to your Canonical Calendar&lt;/P&gt;&lt;P&gt;SET ThousandSep=',';&lt;BR /&gt;SET DecimalSep='.';&lt;BR /&gt;SET MoneyThousandSep=',';&lt;BR /&gt;SET MoneyDecimalSep='.';&lt;BR /&gt;SET DateFormat='YYYY-MM-DD';&lt;BR /&gt;SET TimeFormat='hh:mm:ss';&lt;BR /&gt;SET TimestampFormat='YYYY-MM-DD hh:mm:ss[.fff]';&lt;BR /&gt;SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&lt;BR /&gt;SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&lt;/P&gt;&lt;P&gt;QuartersMap:&lt;BR /&gt;MAPPING LOAD&lt;BR /&gt;rowno() as Month,&lt;BR /&gt;'Q' &amp;amp; Ceil (rowno()/3) as Quarter&lt;BR /&gt;AUTOGENERATE (12);&lt;/P&gt;&lt;P&gt;// Determine the min and max dates from your DateBridge&lt;BR /&gt;TempMinMax:&lt;BR /&gt;LOAD&lt;BR /&gt;Min([Canonical_Date]) AS MinDate,&lt;BR /&gt;Max([Canonical_Date]) AS MaxDate&lt;BR /&gt;RESIDENT DateBridge;&lt;/P&gt;&lt;P&gt;LET vMinDate = Num(Peek('MinDate', -1, 'TempMinMax'));&lt;BR /&gt;LET vMaxDate = Num(Peek('MaxDate', -1, 'TempMinMax'));&lt;BR /&gt;DROP TABLE TempMinMax;&lt;/P&gt;&lt;P&gt;// Generate a continuous date range&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;$(vMinDate) + IterNo() - 1 AS Num,&lt;BR /&gt;Date($(vMinDate) + IterNo() - 1) AS TempDate&lt;BR /&gt;AUTOGENERATE 1 WHILE $(vMinDate) + IterNo() - 1 &amp;lt;= $(vMaxDate);&lt;/P&gt;&lt;P&gt;MasterCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;TempDate AS Date, // Renamed for clarity and consistency&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;ApplyMap('QuartersMap', Month(TempDate), Null()) AS Quarter,&lt;BR /&gt;Week(WeekStart(TempDate)) &amp;amp; '-' &amp;amp; WeekYear(TempDate) AS WeekYear,&lt;BR /&gt;Year(TempDate) &amp;amp; '-' &amp;amp; Month(TempDate) AS YearMonth,&lt;BR /&gt;WeekDay(TempDate) AS WeekDay,&lt;BR /&gt;DayName(TempDate) AS DayName,&lt;BR /&gt;MonthName(TempDate) AS MonthName,&lt;BR /&gt;'Q' &amp;amp; Ceil(Month(TempDate) / 3) AS QuarterOnly, // Added for consistency with typical Master Calendars&lt;BR /&gt;Year(TempDate) &amp;amp; '-Q' &amp;amp; Ceil(Month(TempDate) / 3) AS YearQuarter, // Added for consistency&lt;BR /&gt;Date(MonthStart(TempDate), 'YYYY-MM-DD') AS MonthStart, // Added for consistency&lt;BR /&gt;Date(MonthEnd(TempDate), 'YYYY-MM-DD') AS MonthEnd, // Added for consistency&lt;BR /&gt;Date(WeekStart(TempDate), 'YYYY-MM-DD') AS WeekStart, // Added for consistency&lt;BR /&gt;Date(WeekEnd(TempDate), 'YYYY-MM-DD') AS WeekEnd, // Added for consistency&lt;BR /&gt;Date(YearStart(TempDate), 'YYYY-MM-DD') AS YearStart, // Added for consistency&lt;BR /&gt;Date(YearEnd(TempDate), 'YYYY-MM-DD') AS YearEnd, // Added for consistency&lt;BR /&gt;Num(TempDate) AS DateNumber, // Added for consistency&lt;BR /&gt;Dual(MonthName(TempDate), Month(TempDate)) AS MonthSort, // Added for consistent sorting&lt;BR /&gt;Dual(DayName(TempDate), WeekDay(TempDate)) AS DaySort // Added for consistent sorting&lt;BR /&gt;RESIDENT TempCalendar&lt;BR /&gt;ORDER BY TempDate ASC;&lt;/P&gt;&lt;P&gt;DROP TABLE TempCalendar;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Apr 2025 10:07:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Canonical-amp-Master-Calendars-for-2-Tables-with-Date-fields/m-p/2514582#M105538</guid>
      <dc:creator>RobinTMavhu</dc:creator>
      <dc:date>2025-04-16T10:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Canonical &amp; Master Calendars for 2 Tables with Date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Canonical-amp-Master-Calendars-for-2-Tables-with-Date-fields/m-p/2514619#M105543</link>
      <description>&lt;P&gt;Hi Robin,&lt;/P&gt;&lt;P&gt;The only issue I see in your script is that your date in the date bridge table is called&amp;nbsp;&lt;SPAN&gt;Canonical_Date, while the Master Calendar has the field Date, so if this is your script verbatim, then nothing should link, and no expression should work right.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Other than that, I'd need to see your expressions to understand what's not working right.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Apr 2025 13:29:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Canonical-amp-Master-Calendars-for-2-Tables-with-Date-fields/m-p/2514619#M105543</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2025-04-16T13:29:45Z</dc:date>
    </item>
  </channel>
</rss>

