<?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: Join two tables with Dates between condition (exceptions are also there) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563529#M441485</link>
    <description>&lt;P&gt;It does come up with a single row. Thank you for the kind help.&lt;/P&gt;&lt;P&gt;However, the first condition is to bring the Rate when the time is between Start date and End date. And in this case, if multiple rows are coming up only, then the script should pick up the max End date. Kindly see below example.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled 2.png" style="width: 739px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9214i8669C4586089866D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled 2.png" alt="Untitled 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2019 14:55:50 GMT</pubDate>
    <dc:creator>mithunjacob</dc:creator>
    <dc:date>2019-04-01T14:55:50Z</dc:date>
    <item>
      <title>Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563377#M441479</link>
      <description>&lt;P&gt;I am trying to join two tables based on a date which lies between start date and end date. But there are multiple cases where the condition satisfies this 'in between dates' . In such cases, I need to take Max End date which I am facing challenges. Could you please help?&lt;/P&gt;&lt;P&gt;Key - Code_IM + time in between Start date and End date&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 806px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9197iE6D65BE9A489F63E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 09:49:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563377#M441479</guid>
      <dc:creator>mithunjacob</dc:creator>
      <dc:date>2019-04-01T09:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563483#M441483</link>
      <description>&lt;PRE&gt;Rate:
LOAD START_DATE, 
     END_DATE, 
     CODE_IM, 
     RATE
FROM
[Qlik comm.xls]
(biff, embedded labels, table is Rate$);

right join (Rate)
RateMax:
load
	max(END_DATE) as END_DATE,
	CODE_IM
resident Rate
group by CODE_IM;

left join (Rate)
LOAD TIME, 
     CODE_IM, 
     CODE_P
FROM
[Qlik comm.xls]
(biff, embedded labels, table is Time$);

RateRefresh:
NoConcatenate load * resident Rate
where TIME &amp;gt;= START_DATE and TIME &amp;lt;= END_DATE;

drop table Rate;&lt;/PRE&gt;&lt;P&gt;This will take care of that "max end date" problem.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 13:12:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563483#M441483</guid>
      <dc:creator>mr_janne</dc:creator>
      <dc:date>2019-04-01T13:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563529#M441485</link>
      <description>&lt;P&gt;It does come up with a single row. Thank you for the kind help.&lt;/P&gt;&lt;P&gt;However, the first condition is to bring the Rate when the time is between Start date and End date. And in this case, if multiple rows are coming up only, then the script should pick up the max End date. Kindly see below example.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled 2.png" style="width: 739px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9214i8669C4586089866D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled 2.png" alt="Untitled 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 14:55:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563529#M441485</guid>
      <dc:creator>mithunjacob</dc:creator>
      <dc:date>2019-04-01T14:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563530#M441486</link>
      <description>&lt;P&gt;you need to use inner join IntervalMatch(Time) Load Start_date, End_date resident your_table;&lt;/P&gt;&lt;P&gt;example:&lt;BR /&gt;&lt;SPAN&gt;EventLog: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD * Inline [ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Time, Event, Comment&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;00:00, 0, Start of shift 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;01:18, 1, Line stop&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;02:23, 2, Line restart 50%&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;04:15, 3, Line speed 100%&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;08:00, 4, Start of shift 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;11:43, 5, End of production&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;]; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;OrderLog:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD * INLINE [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start, End, Order&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;01:00, 03:35, A&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;02:30, 07:58, B&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;03:04, 10:27, C&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;07:23, 11:43, D&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Link the field Time to the time intervals defined by the fields Start and End. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Inner Join IntervalMatch ( Time )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LOAD Start, End&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident OrderLog;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Note: ending the script at this point will result in a synthetic key; you need to make additional inner join&lt;BR /&gt;send me a sample application of yours and I can inform you how to proceed&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 14:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563530#M441486</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2019-04-01T14:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563583#M441489</link>
      <description>&lt;P&gt;Hi Ali,&lt;/P&gt;&lt;P&gt;Below is the one I tried: But it will not solve exception which I posted first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Time:&lt;BR /&gt;LOAD date(floor(TIME),'DD/MM/YYYY') AS TIME,&lt;BR /&gt;CODE_IM,&lt;BR /&gt;CODE_P&lt;BR /&gt;FROM&lt;BR /&gt;[Qlik comm.xls]&lt;BR /&gt;(biff, embedded labels, table is Time$);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;left join(Time)&lt;/P&gt;&lt;P&gt;LOAD START_DATE,&lt;BR /&gt;END_DATE,&lt;BR /&gt;CODE_IM,&lt;BR /&gt;RATE&lt;BR /&gt;FROM&lt;BR /&gt;[Qlik comm.xls]&lt;BR /&gt;(biff, embedded labels, table is Rate$);&lt;/P&gt;&lt;P&gt;Rate:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;load&lt;BR /&gt;TIME,&lt;BR /&gt;START_DATE,&lt;BR /&gt;END_DATE,&lt;BR /&gt;CODE_IM,&lt;BR /&gt;RATE&lt;BR /&gt;resident Time&lt;BR /&gt;where TIME&amp;gt;=START_DATE AND TIME&amp;lt;END_DATE;&lt;BR /&gt;&lt;BR /&gt;Drop table Time;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 17:47:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563583#M441489</guid>
      <dc:creator>mithunjacob</dc:creator>
      <dc:date>2019-04-01T17:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563741#M441498</link>
      <description>&lt;P&gt;check attached qvw file&lt;BR /&gt;I solved it I think &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;let me know if this is the correct solution and I'm ready to explain anything you want to know&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 08:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563741#M441498</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2019-04-02T08:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563787#M441500</link>
      <description>&lt;P&gt;Thank you Ali for checking. I still see some issues. For below example, only one Rate should come (preferably which has Max end date). In the current code, two values are present.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;TIME&lt;/TD&gt;&lt;TD&gt;CODE_IM&lt;/TD&gt;&lt;TD&gt;CODE_P&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;13/03/2019 11:25:57&lt;/TD&gt;&lt;TD&gt;9440813&lt;/TD&gt;&lt;TD&gt;IDSUB&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 02 Apr 2019 09:28:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563787#M441500</guid>
      <dc:creator>mithunjacob</dc:creator>
      <dc:date>2019-04-02T09:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563794#M441501</link>
      <description>&lt;P&gt;ah alright&lt;/P&gt;&lt;P&gt;I fixed it now&lt;/P&gt;&lt;P&gt;check attached qvw file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 09:42:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563794#M441501</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2019-04-02T09:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563802#M441502</link>
      <description>&lt;P&gt;This one please?&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;TIME&lt;/TD&gt;&lt;TD&gt;CODE_IM&lt;/TD&gt;&lt;TD&gt;CODE_P&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;06/05/2018 05:34:37&lt;/TD&gt;&lt;TD&gt;9235103&lt;/TD&gt;&lt;TD&gt;AUSYD&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 02 Apr 2019 10:02:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563802#M441502</guid>
      <dc:creator>mithunjacob</dc:creator>
      <dc:date>2019-04-02T10:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563860#M441506</link>
      <description>&lt;P&gt;this one we have 2 start dates and one end date&lt;/P&gt;&lt;P&gt;which start date you want to take&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sample.PNG" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/9261iA6131D5D775003A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="sample.PNG" alt="sample.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 12:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563860#M441506</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2019-04-02T12:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563895#M441512</link>
      <description>&lt;P&gt;The latest one which is closer to 'Time'. And once again thank you for valuable time and help.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 12:32:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563895#M441512</guid>
      <dc:creator>mithunjacob</dc:creator>
      <dc:date>2019-04-02T12:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563919#M441513</link>
      <description>&lt;P&gt;Sorry, I mean closer but Time&amp;gt;START_DATE&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 12:47:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1563919#M441513</guid>
      <dc:creator>mithunjacob</dc:creator>
      <dc:date>2019-04-02T12:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1564128#M441530</link>
      <description>Then from the final table take records where Time &amp;gt; Start date</description>
      <pubDate>Tue, 02 Apr 2019 17:03:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1564128#M441530</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2019-04-02T17:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables with Dates between condition (exceptions are also there)</title>
      <link>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1564990#M441607</link>
      <description>&lt;P&gt;but for this case TIM is always greater than START DATE (all records are like that)&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 08:19:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Join-two-tables-with-Dates-between-condition-exceptions-are-also/m-p/1564990#M441607</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2019-04-04T08:19:43Z</dc:date>
    </item>
  </channel>
</rss>

