<?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 Join two tables by comparing dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-two-tables-by-comparing-dates/m-p/376129#M702602</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two unrelated tables which i would like to join. Basically the primary table contains 'Interest_Charged' to a client. It has the following fields: Client_ID, Interest_amt and date. The second table has similiar fields for 'Brokerage_Charged' to a client with the following fields: Client_ID, Brokerage_amt, date and trader_ID. Please note that the primary table doesnt have a trader_ID &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two tables have no correlation with the other but i would like to assign a relevent trader_ID based on the dates. Basically I would like to join a trader_ID (from the Second table into the primary) by comparing the dates field of the two tables. So for a data set where Interest_charged.Client_ID = Brokerage_Charged.Client_ID I would like to find the relevant trader_ID where the date value of the two tables are the closest or minimum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one help me?&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;Faisal&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2012 10:42:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-08-08T10:42:17Z</dc:date>
    <item>
      <title>Join two tables by comparing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-by-comparing-dates/m-p/376129#M702602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two unrelated tables which i would like to join. Basically the primary table contains 'Interest_Charged' to a client. It has the following fields: Client_ID, Interest_amt and date. The second table has similiar fields for 'Brokerage_Charged' to a client with the following fields: Client_ID, Brokerage_amt, date and trader_ID. Please note that the primary table doesnt have a trader_ID &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two tables have no correlation with the other but i would like to assign a relevent trader_ID based on the dates. Basically I would like to join a trader_ID (from the Second table into the primary) by comparing the dates field of the two tables. So for a data set where Interest_charged.Client_ID = Brokerage_Charged.Client_ID I would like to find the relevant trader_ID where the date value of the two tables are the closest or minimum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one help me?&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;Faisal&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 10:42:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-by-comparing-dates/m-p/376129#M702602</guid>
      <dc:creator />
      <dc:date>2012-08-08T10:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables by comparing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-by-comparing-dates/m-p/376130#M702604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Date field are the same? what if data from primary table will not exists in secondary&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lets start with attached qvw...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 13:31:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-by-comparing-dates/m-p/376130#M702604</guid>
      <dc:creator />
      <dc:date>2012-08-08T13:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables by comparing dates</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-by-comparing-dates/m-p/376131#M702605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The date fields might not be the same. However Client_ID will be the same, so you will find the same client_ID in the brokerage table and interest table. Essentially i want to find the trader_ID in the brokerage table where Interest.Client_ID = Brokerage.Client_ID and Brokerage.date &amp;lt;= Interest.date but the row with the closest date should be joined . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have edited your xlsx fileto decipt the scenario &lt;/P&gt;&lt;P&gt;&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;Faisal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2012 05:08:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-by-comparing-dates/m-p/376131#M702605</guid>
      <dc:creator />
      <dc:date>2012-08-09T05:08:38Z</dc:date>
    </item>
  </channel>
</rss>

