<?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: (Availability) Calendar based on two dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Availability-Calendar-based-on-two-dates/m-p/1079272#M524018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this out for creating calendar based on two dates: &lt;A href="https://community.qlik.com/qlik-blogpost/3585"&gt;Canonical Date&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 09 Feb 2016 13:41:38 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-02-09T13:41:38Z</dc:date>
    <item>
      <title>(Availability) Calendar based on two dates</title>
      <link>https://community.qlik.com/t5/QlikView/Availability-Calendar-based-on-two-dates/m-p/1079271#M524017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to calculate availability for some servers and I'm trying to figure out how to do this based on two dates and duration of the event. This is how my table looks like:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/114025_pastedImage_58.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;As you can see there is one server (ID 9) that's been down for little more than two months. I want to "split" this value so I can show duration for each month. For this server I would like to able to visualize it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2015-07: xxxx seconds (first_date - 2015-07-31 23:59:59) &lt;/P&gt;&lt;P&gt;2015-08: xxxx seconds (2015-08-01 00:00:00 - 2015-08-31 23:59:59)&lt;/P&gt;&lt;P&gt;2015-09: xxxx seconds (2015-09-01 00:00:00 - end_date)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 12:24:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Availability-Calendar-based-on-two-dates/m-p/1079271#M524017</guid>
      <dc:creator />
      <dc:date>2016-02-09T12:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: (Availability) Calendar based on two dates</title>
      <link>https://community.qlik.com/t5/QlikView/Availability-Calendar-based-on-two-dates/m-p/1079272#M524018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this out for creating calendar based on two dates: &lt;A href="https://community.qlik.com/qlik-blogpost/3585"&gt;Canonical Date&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 13:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Availability-Calendar-based-on-two-dates/m-p/1079272#M524018</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-09T13:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: (Availability) Calendar based on two dates</title>
      <link>https://community.qlik.com/t5/QlikView/Availability-Calendar-based-on-two-dates/m-p/1079273#M524019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wouldn't use Canonical dates for this. Instead I would create reference dates within the intervals. See See &lt;A href="https://community.qlik.com/qlik-blogpost/2940"&gt;Creating Reference Dates for Intervals&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script could then be&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Month(Date) as Month,&lt;/P&gt;&lt;P&gt;&amp;nbsp; EndTime - StartTime as Duration&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Time(If(first_date&amp;gt;Date,Frac(first_date),0)) as StartTime,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Time(If(end_date&amp;lt;DayEnd(Date),Frac(end_date),Frac(DayEnd(Date)))) as EndTime&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp; first_date,&lt;/P&gt;&lt;P&gt;&amp;nbsp; end_date,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Date(DayStart(first_date)+IterNo()-1) as Date&lt;/P&gt;&lt;P&gt;From &amp;lt;Source&amp;gt;&lt;/P&gt;&lt;P&gt;While IterNo()&amp;lt;=1 + DayStart(end_date) - DayStart(first_date);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you get a field with the duration within each date, so you can create a bar chart with month as dimension and Sum(Duration) as measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 14:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Availability-Calendar-based-on-two-dates/m-p/1079273#M524019</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2016-02-09T14:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: (Availability) Calendar based on two dates</title>
      <link>https://community.qlik.com/t5/QlikView/Availability-Calendar-based-on-two-dates/m-p/1079274#M524020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks great! Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Feb 2016 14:46:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Availability-Calendar-based-on-two-dates/m-p/1079274#M524020</guid>
      <dc:creator />
      <dc:date>2016-02-09T14:46:22Z</dc:date>
    </item>
  </channel>
</rss>

