<?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: Joining two tables on a date range in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Joining-two-tables-on-a-date-range/m-p/671389#M243906</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, IntervalMatch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Sep 2014 21:09:46 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2014-09-10T21:09:46Z</dc:date>
    <item>
      <title>Joining two tables on a date range</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-two-tables-on-a-date-range/m-p/671388#M243905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all. I have a complex problem that I'm having trouble with. So I have three tables, invoices, work items, and customers. Customers have a customer ID. Invoices have an invoice date, customer ID, and amount. Work items have a customer ID, start date, and end date. There is no work item ID, as this is a derived dimension. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to tie invoices to work items, by checking if the invoice date is between the start and end date of the work item for a given customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've found one solution for this. but it's terribly inefficient. I generate a date key in a mapping load for every day between the start and end dates for the work items, then generate a date key for the invoice date, and then link the invoice to the work item via the date keys. This mapping load ends up being 60 million + rows, and takes 20 minutes to load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is, is there a more elegant way to join one table to another via a date, where you only have a date range?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:04:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-two-tables-on-a-date-range/m-p/671388#M243905</guid>
      <dc:creator />
      <dc:date>2014-09-10T21:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Joining two tables on a date range</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-two-tables-on-a-date-range/m-p/671389#M243906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, IntervalMatch&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:09:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-two-tables-on-a-date-range/m-p/671389#M243906</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-09-10T21:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Joining two tables on a date range</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-two-tables-on-a-date-range/m-p/671390#M243907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I did look into intervalmatch. The main issue I have is it's not just a simple date comparison. I also have the customer ID as well. I need to match the invoice date to the work item start/end range over each customer ID. So I might need to create a composite key. Can intervalmatch do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I'm concerned about the performance using a synthetic key. I've always learned that synthetic keys are bad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I've attached an example QVW, and as you can see, intervalmatch doesn't work because it's not a simple date range, there's the extra customer ID that needs to be used to split it up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 21:26:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-two-tables-on-a-date-range/m-p/671390#M243907</guid>
      <dc:creator />
      <dc:date>2014-09-10T21:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Joining two tables on a date range</title>
      <link>https://community.qlik.com/t5/QlikView/Joining-two-tables-on-a-date-range/m-p/671391#M243908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, there is an extended IntervalMatch syntax with additional parameters/keyfields for slowly changing dimensions and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, Synthetic Keys are not always bad:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/10279"&gt;Should We Stop Worrying and Love the Synthetic Key?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/04/16/synthetic-keys" title="http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/16/synthetic-keys"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/16/synthetic-keys&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and particularly&lt;SPAN style="color: #222222; font-family: arial, sans-serif; font-size: 12pt;"&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/04/04/intervalmatch" title="http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/04/intervalmatch"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/04/intervalmatch&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;Henric Cronström&lt;/A&gt; states that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; background-color: #f5faf0; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;EM&gt;"Further, the data model contains a composite key (the FromDate and ToDate fields) which will manifest itself as a QlikView synthetic key. But have no fear. This synthetic key &lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;EM&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;STRONG&gt;should&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #f5faf0;"&gt; be there; not only is it correct, but it is also optimal given the data model. You do &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f5faf0;"&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #f5faf0; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;EM&gt; need to remove it."&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&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>Wed, 10 Sep 2014 22:02:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Joining-two-tables-on-a-date-range/m-p/671391#M243908</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-09-10T22:02:52Z</dc:date>
    </item>
  </channel>
</rss>

