<?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 Interval match function in Calender Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Interval-match-function-in-Calender-Script/m-p/46322#M7713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am creating a gantt chart in a pivot table. It has to look as it looks in excel. A chart will not do. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are multiple dates: StartDate1, EndDate1, &lt;SPAN style="font-size: 13.3333px;"&gt;StartDate2, EndDate2, &lt;SPAN style="font-size: 13.3333px;"&gt;StartDate3, EndDate3, TargetDate&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have manage to put all these dates in the pivot table and it looks fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue I am facing now is filling in the gaps between the 'StartDate's and 'EndDate's. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Start and End dates are&amp;nbsp; grey, purple and orange&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brown and yellow are Target dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement an interval match function to create a range between the Start and End dates but with no success&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the Calender script I am using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//===================================================&lt;/P&gt;&lt;P&gt;// Subroutine to Generate Calendar. &lt;/P&gt;&lt;P&gt;//===================================================&lt;/P&gt;&lt;P&gt;SUB CalendarFromField(_field, _calendar, _prefix)&lt;/P&gt;&lt;P&gt;[$(_calendar)]:&lt;/P&gt;&lt;P&gt;// Generate Final Calendar&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[$(_field)]&lt;/P&gt;&lt;P&gt;,year([$(_field)]) as [$(_prefix)Year]&lt;/P&gt;&lt;P&gt;,month([$(_field)]) as [$(_prefix)Month]&lt;/P&gt;&lt;P&gt;,day([$(_field)]) as [$(_prefix)Day]&lt;/P&gt;&lt;P&gt;,weekday([$(_field)]) as [$(_prefix)Weekday]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;// Generate range of dates between min and max.&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;date(DateMin + IterNo()) as [$(_field)] // Link Field&lt;/P&gt;&lt;P&gt;WHILE DateMin + IterNo() &amp;lt;= DateMax&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;// Find min and max of date field values.&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;min(datefield)-1 as DateMin&lt;/P&gt;&lt;P&gt;,max(datefield) as DateMax&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;// Load date field values.&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;FieldValue('$(_field)', RecNo()) as datefield&lt;/P&gt;&lt;P&gt;AutoGenerate FieldValueCount('$(_field)');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END SUB&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;After creating individual Date tables using resident load, I call them:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL CalendarFromField('Date', 'CommonCalendar', '');&lt;/P&gt;&lt;P&gt;CALL CalendarFromField('StartDate1', 'CalendarSD', 'SD'); &lt;/P&gt;&lt;P&gt;CALL CalendarFromField('EndDate1', 'CalendarED', 'ED');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody help me implement Interval match in the script above. I'd appreciate the help. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 04 Mar 2018 19:07:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-03-04T19:07:07Z</dc:date>
    <item>
      <title>Interval match function in Calender Script</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-match-function-in-Calender-Script/m-p/46322#M7713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am creating a gantt chart in a pivot table. It has to look as it looks in excel. A chart will not do. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are multiple dates: StartDate1, EndDate1, &lt;SPAN style="font-size: 13.3333px;"&gt;StartDate2, EndDate2, &lt;SPAN style="font-size: 13.3333px;"&gt;StartDate3, EndDate3, TargetDate&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have manage to put all these dates in the pivot table and it looks fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue I am facing now is filling in the gaps between the 'StartDate's and 'EndDate's. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Start and End dates are&amp;nbsp; grey, purple and orange&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brown and yellow are Target dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to implement an interval match function to create a range between the Start and End dates but with no success&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the Calender script I am using:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//===================================================&lt;/P&gt;&lt;P&gt;// Subroutine to Generate Calendar. &lt;/P&gt;&lt;P&gt;//===================================================&lt;/P&gt;&lt;P&gt;SUB CalendarFromField(_field, _calendar, _prefix)&lt;/P&gt;&lt;P&gt;[$(_calendar)]:&lt;/P&gt;&lt;P&gt;// Generate Final Calendar&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[$(_field)]&lt;/P&gt;&lt;P&gt;,year([$(_field)]) as [$(_prefix)Year]&lt;/P&gt;&lt;P&gt;,month([$(_field)]) as [$(_prefix)Month]&lt;/P&gt;&lt;P&gt;,day([$(_field)]) as [$(_prefix)Day]&lt;/P&gt;&lt;P&gt;,weekday([$(_field)]) as [$(_prefix)Weekday]&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;// Generate range of dates between min and max.&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;date(DateMin + IterNo()) as [$(_field)] // Link Field&lt;/P&gt;&lt;P&gt;WHILE DateMin + IterNo() &amp;lt;= DateMax&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;// Find min and max of date field values.&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;min(datefield)-1 as DateMin&lt;/P&gt;&lt;P&gt;,max(datefield) as DateMax&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;// Load date field values.&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;FieldValue('$(_field)', RecNo()) as datefield&lt;/P&gt;&lt;P&gt;AutoGenerate FieldValueCount('$(_field)');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END SUB&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;After creating individual Date tables using resident load, I call them:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL CalendarFromField('Date', 'CommonCalendar', '');&lt;/P&gt;&lt;P&gt;CALL CalendarFromField('StartDate1', 'CalendarSD', 'SD'); &lt;/P&gt;&lt;P&gt;CALL CalendarFromField('EndDate1', 'CalendarED', 'ED');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody help me implement Interval match in the script above. I'd appreciate the help. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Mar 2018 19:07:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-match-function-in-Calender-Script/m-p/46322#M7713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-03-04T19:07:07Z</dc:date>
    </item>
  </channel>
</rss>

