<?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: Interval Matching Dates With Multiple Keys in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Interval-Matching-Dates-With-Multiple-Keys/m-p/1530162#M1018480</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we get this data in our fact table.If We require to end up in one table.&lt;/P&gt;&lt;P&gt;Kindly Help!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Jan 2019 18:54:37 GMT</pubDate>
    <dc:creator>sudhanshu123</dc:creator>
    <dc:date>2019-01-14T18:54:37Z</dc:date>
    <item>
      <title>Interval Matching Dates With Multiple Keys</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Matching-Dates-With-Multiple-Keys/m-p/791828#M1018478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I Have been having trouble with interval matching. I have two tables. One that has the Date intervals call it IntervalTable,&lt;/P&gt;&lt;P&gt;and a second table with the dates call it FactTable. Both tables have a key in common and the FactTable also has another field that is just a counter (could be something else).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just made up some tables to illustrate the problem. The FinalTable is what I want. When I try I either lose some data or my track field is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IntervalTable:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FactTable:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalResult:&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have tried so far is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IntervalTable:&lt;/P&gt;&lt;P&gt;Load Field, Start, End, Fruit&lt;/P&gt;&lt;P&gt;From [];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FactTable:&lt;/P&gt;&lt;P&gt;Load Date, Field, Counter&lt;/P&gt;&lt;P&gt;From[];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Intervalmatch(Date, Field) Left Join&lt;/P&gt;&lt;P&gt;Load Start, End, Field&lt;/P&gt;&lt;P&gt;Resident IntervalTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join (FactTable)&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;Resident IntervalTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table IntervalTable;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 19:01:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Matching-Dates-With-Multiple-Keys/m-p/791828#M1018478</guid>
      <dc:creator />
      <dc:date>2015-03-25T19:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Matching Dates With Multiple Keys</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Matching-Dates-With-Multiple-Keys/m-p/791829#M1018479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the following. See also &lt;A href="https://community.qlik.com/qlik-blogpost/3148"&gt;Slowly Changing Dimensions&lt;/A&gt;&lt;/P&gt;&lt;P&gt;/HIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IntervalTable:&lt;/P&gt;&lt;P&gt;Load Field, Start, End, Fruit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Field &amp;amp; '|' &amp;amp; Start &amp;amp; '|' &amp;amp; End as IntervalKey&lt;/P&gt;&lt;P&gt;From [];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FactTable:&lt;/P&gt;&lt;P&gt;Load Date, Field, Counter,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Field &amp;amp; '|' &amp;amp; Date as DateKey&lt;/P&gt;&lt;P&gt;From[];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmpBridge:&lt;/P&gt;&lt;P&gt;Intervalmatch(Date, Field)&lt;/P&gt;&lt;P&gt;Load Start, End, Field&lt;/P&gt;&lt;P&gt;Resident IntervalTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bridge:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Field &amp;amp; '|' &amp;amp; Start &amp;amp; '|' &amp;amp; End as IntervalKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Field &amp;amp; '|' &amp;amp; Date as DateKey&lt;/P&gt;&lt;P&gt;Resident tmpBridge;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table tmpBridge;&lt;/P&gt;&lt;P&gt;Drop Field Field From FactTable;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2015 21:29:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Matching-Dates-With-Multiple-Keys/m-p/791829#M1018479</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2015-03-25T21:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Matching Dates With Multiple Keys</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Matching-Dates-With-Multiple-Keys/m-p/1530162#M1018480</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we get this data in our fact table.If We require to end up in one table.&lt;/P&gt;&lt;P&gt;Kindly Help!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 18:54:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Matching-Dates-With-Multiple-Keys/m-p/1530162#M1018480</guid>
      <dc:creator>sudhanshu123</dc:creator>
      <dc:date>2019-01-14T18:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Matching Dates With Multiple Keys</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Matching-Dates-With-Multiple-Keys/m-p/1679026#M1018481</link>
      <description>&lt;P&gt;Hi, Henric!&lt;/P&gt;&lt;P&gt;Could you help me please?&lt;/P&gt;&lt;P&gt;In my case only difference to example above is I have 3 key fields in tables.&amp;nbsp; I did exactly as you advised. But there is one problem.&amp;nbsp; Field 'counter' doesn't connect to the rest data model. If i drop field 'field' from IntervalTable, field 'Fruit' doesn't connect to the rest table.&lt;/P&gt;&lt;P&gt;And one more moment I can't understand: in Table Viewer&amp;nbsp; table Bridge doesn't have any rows.&lt;/P&gt;&lt;P&gt;My script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FactTable:&lt;BR /&gt;LOAD&amp;nbsp;&lt;BR /&gt;field1 &amp;amp; '|' &amp;amp; field2 &amp;amp; '|' &amp;amp; field3 &amp;amp; '|' &amp;amp; Date as %DateKey,&lt;BR /&gt;Date, field1, field2, field3, counter&lt;BR /&gt;FROM [] (qvd);&lt;/P&gt;&lt;P&gt;IntervalTable:&lt;BR /&gt;LOAD&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; field1 &amp;amp; '|' &amp;amp; field2 &amp;amp; '|' &amp;amp; field3 &amp;amp; '|' &amp;amp; Start&amp;nbsp; &amp;amp; '|' &amp;amp;&amp;nbsp; End&amp;nbsp; as %IntervalKey ,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Start,End, field1, field2, field3, Fruit&lt;BR /&gt;FROM [] (qvd);&lt;/P&gt;&lt;P&gt;tmpBridge:&lt;BR /&gt;IntervalMatch(Date, field1, field2, field3)&lt;BR /&gt;LOAD&amp;nbsp;&lt;BR /&gt;Start, End, field1, field2, field3&lt;BR /&gt;Resident IntervalTable;&lt;/P&gt;&lt;P&gt;Bridge:&lt;BR /&gt;LOAD&lt;BR /&gt;field1 &amp;amp; '|' &amp;amp; field2 &amp;amp; '|' &amp;amp; field3 &amp;amp; '|' &amp;amp; Start &amp;amp; '|' &amp;amp; End as %IntervalKey,&lt;BR /&gt;field1 &amp;amp; '|' &amp;amp; field2 &amp;amp; '|' &amp;amp; field3 &amp;amp; '|' &amp;amp; Date as %DateKey&lt;BR /&gt;Resident tmpBridge;&lt;/P&gt;&lt;P&gt;DROP Table tmpBridge;&lt;BR /&gt;DROP fields field1, field2, field3 from FactTable;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 12:50:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Matching-Dates-With-Multiple-Keys/m-p/1679026#M1018481</guid>
      <dc:creator>AlexChirkin</dc:creator>
      <dc:date>2020-02-25T12:50:55Z</dc:date>
    </item>
  </channel>
</rss>

