<?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: Match two time intervals in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052547#M353136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should do the trick:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14576849012372207" jivemacro_uid="_14576849012372207"&gt;
&lt;P&gt;Intervals:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;StartDate, EndDate&lt;/P&gt;
&lt;P&gt;2015-05-01, 2015-05-31&lt;/P&gt;
&lt;P&gt;2015-04-15, 2015-05-15&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TempDates:&lt;/P&gt;
&lt;P&gt;LOAD StartDate as Date, 'Start' as Type Resident Intervals;&lt;/P&gt;
&lt;P&gt;LOAD EndDate as Date, 'End' as Type Resident Intervals;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NewIntervals:&lt;/P&gt;
&lt;P&gt;LOAD * WHERE End&amp;gt;0;&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Type = 'Start', Date, Date(Date+1)) as Start,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Type = 'Start' and Previous(Type) = 'Start', Date(Previous(Date)-1),Date(Previous(Date))) as End&lt;/P&gt;
&lt;P&gt;Resident TempDates Order By Date desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table TempDates;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Mar 2016 08:28:44 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2016-03-11T08:28:44Z</dc:date>
    <item>
      <title>Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052541#M353130</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 need to match two time intervals like in the below example. I found this example but looks too complicated. Any idea how to get it easier? I've tried with master calendar but didn't get me to the needed results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Intervals1:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align:center;background-color:#6690BC;color:#ffffff;padding:2px;" valign="middle"&gt;&lt;STRONG&gt;StartDate1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align:center;background-color:#6690BC;color:#ffffff;padding:2px;" valign="middle"&gt;&lt;STRONG&gt;EndDate1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-05-01&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-05-31&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Intervals2:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;StartDate2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;EndDate2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-04-15&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-05-15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Results:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;StartDate1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;EndDate1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-04-15&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-04-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-05-01&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-05-15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-05-16&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2015-05-31&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Przemek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 23:15:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052541#M353130</guid>
      <dc:creator />
      <dc:date>2016-03-10T23:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052542#M353131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And could you comment on how you retrieve the resulting records from your input records?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 23:24:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052542#M353131</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-10T23:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052543#M353132</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;maybe this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/download/4310-5-63650/IntervalMatch and Slowly Changing Dimensions.pdf" title="https://community.qlik.com/servlet/JiveServlet/download/4310-5-63650/IntervalMatch%20and%20Slowly%20Changing%20Dimensions.pdf"&gt;https://community.qlik.com/servlet/JiveServlet/download/4310-5-63650/IntervalMatch%20and%20Slowly%20Changing%20Dimension…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(pages 17ff.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2016 23:25:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052543#M353132</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-03-10T23:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052544#M353133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See if this sample can help, your logic of adding or subtracting 1 sometimes in start date or end date is complicated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to first combined all the dates in one field and then created interval through script.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/117674_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;Load Date(Date#(StartDate1,'YYYY-MM-DD'),'YYYY-MM-DD') as Date&lt;/P&gt;&lt;P&gt;inline [&lt;/P&gt;&lt;P&gt;StartDate1, EndDate1&lt;/P&gt;&lt;P&gt;2015-05-01,2015-05-31 ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Date(Date#(EndDate1,'YYYY-MM-DD'),'YYYY-MM-DD') as Date&lt;/P&gt;&lt;P&gt;inline [&lt;/P&gt;&lt;P&gt;StartDate1, EndDate1&lt;/P&gt;&lt;P&gt;2015-05-01,2015-05-31 ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Date(Date#(StartDate1,'YYYY-MM-DD'),'YYYY-MM-DD') as Date&lt;/P&gt;&lt;P&gt;inline [&lt;/P&gt;&lt;P&gt;StartDate1, EndDate1&lt;/P&gt;&lt;P&gt;2015-05-01,2015-05-31 ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Date(Date#(StartDate2,'YYYY-MM-DD'),'YYYY-MM-DD') as Date&lt;/P&gt;&lt;P&gt;inline [&lt;/P&gt;&lt;P&gt;StartDate2, EndDate2&lt;/P&gt;&lt;P&gt;2015-04-15,2015-05-15 ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Date(Date#(EndDate2,'YYYY-MM-DD'),'YYYY-MM-DD') as Date&lt;/P&gt;&lt;P&gt;inline [&lt;/P&gt;&lt;P&gt;StartDate2, EndDate2&lt;/P&gt;&lt;P&gt;2015-04-15,2015-05-15 ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let TotalRows = NoOfRows('T1');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 1 to $(TotalRows)-2&lt;/P&gt;&lt;P&gt;&amp;nbsp; T2:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Load $(i) as SNO,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(i)=1,min(Date(Date#(Date,'YYYY-MM-DD'),'YYYY-MM-DD'),$(i)),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; min(Date(Date#(Date,'YYYY-MM-DD')+1,'YYYY-MM-DD'),$(i))) as StartDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp; min(Date(Date#(Date,'YYYY-MM-DD'),'YYYY-MM-DD'),$(i)+1) as EndDate&lt;/P&gt;&lt;P&gt;&amp;nbsp; Resident T1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Order By Date;&lt;/P&gt;&lt;P&gt;NEXT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 06:49:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052544#M353133</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2016-03-11T06:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052545#M353134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, yeas - my case is Henric's type "Two interval tables mapped against a common dimension ID and a common time line". The actual datamodel includes also id to be matched. Could you please give me some more hint on how to create the bridge tables and subintervals?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Intervals1:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;THEAD style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG&gt;Id&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;StartDate1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;EndDate1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-05-01&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-05-31&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Intervals2:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;THEAD style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG&gt;Id&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;StartDate2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;EndDate2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-04-15&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-05-15&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Results:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;THEAD style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG&gt;Id&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;StartDate1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;EndDate1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-04-15&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-04-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-05-01&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-05-15&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-05-16&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center;"&gt;2015-05-31&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Przemek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 07:32:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052545#M353134</guid>
      <dc:creator />
      <dc:date>2016-03-11T07:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052546#M353135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Forgot to paste link - this was Henric's example: &lt;A _jive_internal="true" href="https://community.qlik.com/thread/75435?q=Match two intervals" title="https://community.qlik.com/thread/75435?q=Match%20two%20intervals"&gt;https://community.qlik.com/thread/75435?q=Match%20two%20intervals&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to retrieve the records by matching the intervals.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 07:34:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052546#M353135</guid>
      <dc:creator />
      <dc:date>2016-03-11T07:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052547#M353136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should do the trick:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14576849012372207" jivemacro_uid="_14576849012372207"&gt;
&lt;P&gt;Intervals:&lt;/P&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;StartDate, EndDate&lt;/P&gt;
&lt;P&gt;2015-05-01, 2015-05-31&lt;/P&gt;
&lt;P&gt;2015-04-15, 2015-05-15&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TempDates:&lt;/P&gt;
&lt;P&gt;LOAD StartDate as Date, 'Start' as Type Resident Intervals;&lt;/P&gt;
&lt;P&gt;LOAD EndDate as Date, 'End' as Type Resident Intervals;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NewIntervals:&lt;/P&gt;
&lt;P&gt;LOAD * WHERE End&amp;gt;0;&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Type = 'Start', Date, Date(Date+1)) as Start,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Type = 'Start' and Previous(Type) = 'Start', Date(Previous(Date)-1),Date(Previous(Date))) as End&lt;/P&gt;
&lt;P&gt;Resident TempDates Order By Date desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table TempDates;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 08:28:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052547#M353136</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-03-11T08:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052548#M353137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Gysbert. Looks tempting because of its easiness. But how would it look like if we had intervals as such:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Intervals:&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;LOAD * INLINE [&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Id, StartDate, EndDate&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;1, 2015-05-01, 2015-05-31&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;1, 2015-04-15, 2015-05-15&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2, 2015-02-01, 2015-02-31&amp;nbsp; &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;2, 2015-01-15, 2015-02-15 &lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 08:43:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052548#M353137</guid>
      <dc:creator />
      <dc:date>2016-03-11T08:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052549#M353138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Digvijay. I've tried to integrate Id column into your code but failed. Would you be able to help with it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 08:45:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052549#M353138</guid>
      <dc:creator />
      <dc:date>2016-03-11T08:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052550#M353139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would look quite strange since 2015-02-31 is not a valid date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to add Id's to the mix it will look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_1457687665443479 jive_text_macro" jivemacro_uid="_1457687665443479"&gt;
&lt;P&gt;Intervals: &lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Id, &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date#(StartDate,'YYYY-MM-DD') as StartDate, &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date#(EndDate,'YYYY-MM-DD') as EndDate&amp;nbsp; &lt;/P&gt;
&lt;P&gt;INLINE [ &lt;/P&gt;
&lt;P&gt;Id, StartDate, EndDate &lt;/P&gt;
&lt;P&gt;1, 2015-05-01, 2015-05-31 &lt;/P&gt;
&lt;P&gt;1, 2015-04-15, 2015-05-15&lt;/P&gt;
&lt;P&gt;2, 2015-02-01, 2015-02-28 &lt;/P&gt;
&lt;P&gt;2, 2015-01-15, 2015-02-15&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;TempDates:&lt;/P&gt;
&lt;P&gt;LOAD Id, StartDate as Date, 'Start' as Type Resident Intervals;&lt;/P&gt;
&lt;P&gt;LOAD Id, EndDate as Date, 'End' as Type Resident Intervals;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;NewIntervals:&lt;/P&gt;
&lt;P&gt;LOAD * WHERE End&amp;gt;0;&lt;/P&gt;
&lt;P&gt;LOAD &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Id,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Type = 'Start', Date, If(Id = Previous(Id), Date(Date+1))) as Start,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Id = Previous(Id), &lt;/P&gt;
&lt;P&gt;&amp;nbsp; if(Type = 'Start' and Previous(Type) = 'Start', &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Previous(Date)-1), &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date(Previous(Date)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp; )&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ) as End&lt;/P&gt;
&lt;P&gt;Resident TempDates Order By Id, Date desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table TempDates;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 09:15:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052550#M353139</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-03-11T09:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052551#M353140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As per logic start date and end date are picked up from different source Ids, It seems you need two Ids in one final record, one for start date source record and another for end date source record. Not sure though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 09:27:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052551#M353140</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2016-03-11T09:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052552#M353141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am bit late today.&lt;/P&gt;&lt;P&gt;There was a recent similar discussion on how to match intervals with IDs, have a look at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/207878"&gt;How to check whether certain record timestamps overlap...&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should demonstrate also how to interval match the subintervals back into the original intervals (so you get the information for each subinterval which original intervals contribute).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the referenced sample QVW, there are two keys to consider, localilty and machine ID, so I think you should be able easily create a solution for your specific requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 10:17:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052552#M353141</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-11T10:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Match two time intervals</title>
      <link>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052553#M353142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed, it'd look strange with 2015-02-31 &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Very many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Mar 2016 12:30:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-two-time-intervals/m-p/1052553#M353142</guid>
      <dc:creator />
      <dc:date>2016-03-11T12:30:38Z</dc:date>
    </item>
  </channel>
</rss>

