<?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: IntervalMatch without an Ending Date (or max value) in match table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383994#M701683</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can try to implement your logics manualy taking into account your restrictions.&lt;/P&gt;&lt;P&gt;IntervalMatch just saves time sometimes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can always use firstsortedvalue() or order your tables and use first/lastvalue functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Sep 2012 14:18:55 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2012-09-05T14:18:55Z</dc:date>
    <item>
      <title>IntervalMatch without an Ending Date (or max value) in match table</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383989#M701678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the purpose of this question, I am providing a small, simple example. One is a table with sale transactions made to customers (Sales) and the other is a table with transactions of the company buying the product from the vendor (Purchase). I want to join our purchase information with the sale information so each sale will have our cost and purchase date with it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no end date for these product prices (it is effective until the next purchase of the product). The cost record to be associated with the sale should be the most recent record in the purchase table relative to the sale date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;purchase&lt;/STRONG&gt;: load * inline&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[SKU, PurchaseDate, PurchasePrice&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;101, 1/15/2012, 1.15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #008000;"&gt;102, 2/13/2012, 5.05&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #ff6600;"&gt;102, 6/22/2012, 6.17&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #800000;"&gt;101, 8/02/2012, 2.38&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;sales&lt;/STRONG&gt;: load * inline&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[SKU, SaleDate, SalePrice&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 1/19/2012, 4.25&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 1/30/2012, 4.25&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;102, 4/15/2012, 14.50&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 5/01/2012, 4.75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 7/14/2012, 4.75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;102, 7/16/2012, 17.50&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;102, 8/15/2012, 17.50&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 8/19/2012, 5.75&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;The result should be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SKU, SaleDate,&amp;nbsp; SalePrice, PurchaseDate, &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;PurchasePrice&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 1/19/2012, 4.25,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;1/15/2012,&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 1/30/2012, 4.25,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;1/15/2012,&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;102, 4/15/2012, 14.50,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; color: #008000;"&gt;2/13/2012,&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.05&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 5/01/2012, 4.75,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;1/15/2012,&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 7/14/2012, 4.75,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; color: #0000ff;"&gt;1/15/2012,&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.15&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;102, 7/16/2012, 17.50,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; color: #ff6600;"&gt;6/22/2012,&amp;nbsp;&amp;nbsp;&amp;nbsp; 6.17&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;102, 8/15/2012, 17.50,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; color: #ff6600;"&gt;6/22/2012,&amp;nbsp;&amp;nbsp;&amp;nbsp; 6.17&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;101, 8/19/2012, 5.75,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; color: #800000;"&gt;8/02/2012,&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.38&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have searched high and low and read dozens of discussions about IntervalMatch and have not found anyone asking anything similar to this. I apologize if I've missed it somewhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will also want to use the answer to this to attribute the most appropriate direct marketing piece that was mailed to each customer (millions of records) to each sale that was made (millions of records), so any advice on the best and most efficient way to do this is greatly appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It feels like IntervalMatch may not be what I need for this. I'm farily new to QlikView so if I'm off, I'd greatly appreciate being pointed in the right direction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2012 16:43:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383989#M701678</guid>
      <dc:creator>Rich-HHE</dc:creator>
      <dc:date>2012-09-04T16:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch without an Ending Date (or max value) in match table</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383990#M701679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to calculate the end date.&lt;/P&gt;&lt;P&gt; It's not so complicated as you have purchase dates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2012 17:21:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383990#M701679</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-04T17:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch without an Ending Date (or max value) in match table</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383991#M701680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would you suggest I go about calculating the ending dates?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2012 18:11:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383991#M701680</guid>
      <dc:creator>Rich-HHE</dc:creator>
      <dc:date>2012-09-04T18:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch without an Ending Date (or max value) in match table</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383992#M701681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know how. Its your business field. You said:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;it is effective until the next purchase of the product&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Try to work in this direction. In case tha date is somewhere in the future use 01/01/2100 for example.&lt;/P&gt;&lt;P&gt;But if you want to use IntervalMatch you have to do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 07:38:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383992#M701681</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-05T07:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch without an Ending Date (or max value) in match table</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383993#M701682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;But if you want to use IntervalMatch you have to do it.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's what I was afraid of. Not because calculating the ending effective date of a table of purchases would be difficult, but because there are other projects where I will need to relate a table on a "nearest match" where I'm matching 15M records to 36M records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how to set up a fuzzy relationship between two tables? For example, in dBase for DOS (what I currently work in) you can SET NEAR ON and all relationships will be set to "nearest match." The reason I'm not doing this in dBase is because it takes 3-4 days to run each time and I'm hoping to move my analytical programs into QlikView for quicker updates times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: And I know how in theory to calculate the next date. I just don't know functionally in QlikView. I could easily write a program in dBase to go through and calculate the effective ending date but again, this would take too long.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 12:43:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383993#M701682</guid>
      <dc:creator>Rich-HHE</dc:creator>
      <dc:date>2012-09-05T12:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch without an Ending Date (or max value) in match table</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383994#M701683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can try to implement your logics manualy taking into account your restrictions.&lt;/P&gt;&lt;P&gt;IntervalMatch just saves time sometimes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can always use firstsortedvalue() or order your tables and use first/lastvalue functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 14:18:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383994#M701683</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2012-09-05T14:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch without an Ending Date (or max value) in match table</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383995#M701684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. If anyone else has input, I'd be glad to hear it. I will chug away at it and post my working script here (if I ever get one) for others to reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 14:22:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383995#M701684</guid>
      <dc:creator>Rich-HHE</dc:creator>
      <dc:date>2012-09-05T14:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch without an Ending Date (or max value) in match table</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383996#M701685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this to solve end date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;BR /&gt; Load&lt;BR /&gt; *,&lt;BR /&gt; PurchaseDate as StartDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(PurchaseDate&amp;lt;Previous(PurchaseDate),Previous(PurchaseDate)-1, PurchaseDate) as EndDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resident purchase&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Order by SKU,PurchaseDate desc&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;//some kind of join &lt;/P&gt;&lt;P&gt;Intervalmatch(SaleDate, SKU)&lt;BR /&gt;Load StartDate, EndDate, SKU Resident Temp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 08:12:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-without-an-Ending-Date-or-max-value-in-match-table/m-p/383996#M701685</guid>
      <dc:creator>stabben23</dc:creator>
      <dc:date>2012-10-25T08:12:25Z</dc:date>
    </item>
  </channel>
</rss>

