<?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: How to create Master Calendar with Multiple date fields with in the same table and among the tab in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-create-Master-Calendar-with-Multiple-date-fields-with-in/m-p/1662681#M49801</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Personally, I don't tend to have calendar tables in separate tables in my data model, rather create various date parts in each table, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[From Date Time],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date(DayStart([From Date Time]), 'DD MMM YYYY')&amp;nbsp; &amp;nbsp;as [From Date],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Year([From Date Time]) as [From Year],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Month([From Date Time]) as [From Month Name],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date(MonthStart([From Date Time]), 'MMM-YY')&amp;nbsp; &amp;nbsp;as [From Month],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[To Date Time],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date(DayStart([To Date Time]), 'DD MMM YYYY')&amp;nbsp; &amp;nbsp;as [To Date],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Year([To Date Time]) as [To Year],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Month([To Date Time]) as [To Month Name],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date(MonthStart([To Date Time]), 'MMM-YY')&amp;nbsp; &amp;nbsp;as [To Month],&lt;/P&gt;&lt;P&gt;I wrote a &lt;A title="Qlik Calendar Scripts" href="https://www.quickintelligence.co.uk/qlikview-calendar/" target="_self"&gt;blog post&lt;/A&gt; on why I prefer this approach.&lt;/P&gt;&lt;P&gt;This doesn't deal with the problem of gaps in dates though. In some ways, having the gaps helps see where there are missing data, and I would therefore say is a good thing.&lt;/P&gt;&lt;P&gt;You could create a calendar QVD and load from it many times, once for each date, e.g.&lt;/P&gt;&lt;P&gt;FromCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date as [From Date],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Month as [From Month],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Year as [From Year],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[Month Name] as [From Month Name]&lt;BR /&gt;FROM [lib://qvd/Calendar.qvd] (qvd)&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;If you don't want redundant dates at the start and end of each date table you will need to do the max min on each field and use this in a WHERE statement on the QVD. This processing can be slow though.&lt;/P&gt;&lt;P&gt;A better approach may be to create an events table and build the calendar on this. This will give you a single calendar and you can then pick what type of date you are looking at. To do this, first load your MainData table and ensure it has a Unique Key. Then load into an Events table for each date in the table:&lt;/P&gt;&lt;P&gt;Events:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp;1 as DateCount,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;UniqueKey,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;'From Date' as DateType,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[From Date] as Date&lt;BR /&gt;RESIDENT MainData;&lt;/P&gt;&lt;P&gt;Events:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp;1 as DateCount,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;UniqueKey,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;'To Date' as DateType,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[To Date] as Date&lt;BR /&gt;RESIDENT MainData;&lt;/P&gt;&lt;P&gt;You can then hang your calendar table off of the Date field or build it into the table.&lt;/P&gt;&lt;P&gt;This is particularly nice if you have things like support tickets to track, as you can have a line chart with the sum of DateCount on it and a dimension of DateType, then each line would be for things like Tickets Opened, Tickets Closed, Tickets Suspended etc..&lt;/P&gt;&lt;P&gt;As all of these techniques involve doing the same thing many times (once for each date you have) you may want to look into using &lt;A title="Qlik Variables With Parameters" href="https://www.quickintelligence.co.uk/variables-parameters-load-script/" target="_blank" rel="noopener"&gt;variables with parameters&lt;/A&gt; in them, but these can get a bit fiddly.&lt;/P&gt;&lt;P&gt;Hopefully that points you in the right direction.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 05 Jan 2020 15:41:07 GMT</pubDate>
    <dc:creator>stevedark</dc:creator>
    <dc:date>2020-01-05T15:41:07Z</dc:date>
    <item>
      <title>How to create Master Calendar with Multiple date fields with in the same table and among the tables</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-create-Master-Calendar-with-Multiple-date-fields-with-in/m-p/1662656#M49794</link>
      <description>Hi All, I Have nearly 40 tables , in each table has contain 2, 3 dates like some table Created Date, Updated Date, and some tables Created Date, Updated Date,Due Date, Completed Date. And all the tables have their mapping based on the Key fields Here the date fields has contain some missing dates , i need to make them continuous dates Here my question is how to create a master calendar and bring the all the dates and map to that master calendar Thanks for hope help in this area with good suggestions or logic</description>
      <pubDate>Sun, 05 Jan 2020 03:23:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-create-Master-Calendar-with-Multiple-date-fields-with-in/m-p/1662656#M49794</guid>
      <dc:creator>narayanaqlik</dc:creator>
      <dc:date>2020-01-05T03:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Master Calendar with Multiple date fields with in the same table and among the tab</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-create-Master-Calendar-with-Multiple-date-fields-with-in/m-p/1662681#M49801</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Personally, I don't tend to have calendar tables in separate tables in my data model, rather create various date parts in each table, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[From Date Time],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date(DayStart([From Date Time]), 'DD MMM YYYY')&amp;nbsp; &amp;nbsp;as [From Date],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Year([From Date Time]) as [From Year],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Month([From Date Time]) as [From Month Name],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date(MonthStart([From Date Time]), 'MMM-YY')&amp;nbsp; &amp;nbsp;as [From Month],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[To Date Time],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date(DayStart([To Date Time]), 'DD MMM YYYY')&amp;nbsp; &amp;nbsp;as [To Date],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Year([To Date Time]) as [To Year],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Month([To Date Time]) as [To Month Name],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date(MonthStart([To Date Time]), 'MMM-YY')&amp;nbsp; &amp;nbsp;as [To Month],&lt;/P&gt;&lt;P&gt;I wrote a &lt;A title="Qlik Calendar Scripts" href="https://www.quickintelligence.co.uk/qlikview-calendar/" target="_self"&gt;blog post&lt;/A&gt; on why I prefer this approach.&lt;/P&gt;&lt;P&gt;This doesn't deal with the problem of gaps in dates though. In some ways, having the gaps helps see where there are missing data, and I would therefore say is a good thing.&lt;/P&gt;&lt;P&gt;You could create a calendar QVD and load from it many times, once for each date, e.g.&lt;/P&gt;&lt;P&gt;FromCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Date as [From Date],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Month as [From Month],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;Year as [From Year],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[Month Name] as [From Month Name]&lt;BR /&gt;FROM [lib://qvd/Calendar.qvd] (qvd)&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;If you don't want redundant dates at the start and end of each date table you will need to do the max min on each field and use this in a WHERE statement on the QVD. This processing can be slow though.&lt;/P&gt;&lt;P&gt;A better approach may be to create an events table and build the calendar on this. This will give you a single calendar and you can then pick what type of date you are looking at. To do this, first load your MainData table and ensure it has a Unique Key. Then load into an Events table for each date in the table:&lt;/P&gt;&lt;P&gt;Events:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp;1 as DateCount,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;UniqueKey,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;'From Date' as DateType,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[From Date] as Date&lt;BR /&gt;RESIDENT MainData;&lt;/P&gt;&lt;P&gt;Events:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp;1 as DateCount,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;UniqueKey,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;'To Date' as DateType,&lt;BR /&gt;&amp;nbsp; &amp;nbsp;[To Date] as Date&lt;BR /&gt;RESIDENT MainData;&lt;/P&gt;&lt;P&gt;You can then hang your calendar table off of the Date field or build it into the table.&lt;/P&gt;&lt;P&gt;This is particularly nice if you have things like support tickets to track, as you can have a line chart with the sum of DateCount on it and a dimension of DateType, then each line would be for things like Tickets Opened, Tickets Closed, Tickets Suspended etc..&lt;/P&gt;&lt;P&gt;As all of these techniques involve doing the same thing many times (once for each date you have) you may want to look into using &lt;A title="Qlik Variables With Parameters" href="https://www.quickintelligence.co.uk/variables-parameters-load-script/" target="_blank" rel="noopener"&gt;variables with parameters&lt;/A&gt; in them, but these can get a bit fiddly.&lt;/P&gt;&lt;P&gt;Hopefully that points you in the right direction.&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2020 15:41:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-create-Master-Calendar-with-Multiple-date-fields-with-in/m-p/1662681#M49801</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2020-01-05T15:41:07Z</dc:date>
    </item>
  </channel>
</rss>

