<?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 Match using Dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739402#M721259</link>
    <description>&lt;P&gt;This would remove all the other Customers right ? But i have 2 views where i show the priority customers and in another i show all customers&lt;/P&gt;</description>
    <pubDate>Fri, 28 Aug 2020 08:44:31 GMT</pubDate>
    <dc:creator>vmurugananthan</dc:creator>
    <dc:date>2020-08-28T08:44:31Z</dc:date>
    <item>
      <title>Interval Match using Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739238#M721256</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Below is my problem statement&lt;/P&gt;&lt;P&gt;Problem Statement : I have a master data set which has 10 distinct customers. I have another data set (called priority data set) which has 5 among the 10 customers from the master data set. This is basically to flag these 5 customers as priority customers in the master data set. I do this by left joining based on customer number and setting a flag in the master data set.&lt;/P&gt;&lt;P&gt;My requirement is that from the master data set , if the Report Date for a customer is higher than the End Date from priority Data set for that customer, then I need to show the data only until that End date for that customer.Ex: If the End date for a customer is 20-08-2020, then i need to show the fileNumbers for that customer only before this date.&lt;/P&gt;&lt;P&gt;The master data set looks like below&lt;/P&gt;&lt;TABLE width="281"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="119"&gt;CustomerNumber&lt;/TD&gt;&lt;TD width="81"&gt;Report Date&lt;/TD&gt;&lt;TD width="81"&gt;FileNumber&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;10-01-2020&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt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TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Priority data set:&amp;nbsp;&lt;/P&gt;&lt;TABLE width="265"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="119"&gt;CustomerNumber&lt;/TD&gt;&lt;TD width="73"&gt;Start Date&lt;/TD&gt;&lt;TD width="73"&gt;End Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;01-01-2010&lt;/TD&gt;&lt;TD&gt;20-08-2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;01-01-2010&lt;/TD&gt;&lt;TD&gt;01-01-2030&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;01-01-2010&lt;/TD&gt;&lt;TD&gt;01-01-2030&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;01-01-2010&lt;/TD&gt;&lt;TD&gt;01-01-2030&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;01-01-2010&lt;/TD&gt;&lt;TD&gt;01-01-2030&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Output when i set the priority customer flag, should ideally look like:&lt;/P&gt;&lt;TABLE width="209"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="64"&gt;CustomerNumber&lt;/TD&gt;&lt;TD width="81"&gt;Report Date&lt;/TD&gt;&lt;TD width="64"&gt;FileNumber&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;10-01-2020&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;02-02-2020&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;20-02-2020&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;27-03-2020&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;06-06-2020&lt;/TD&gt;&lt;TD&gt;800&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;07-06-2020&lt;/TD&gt;&lt;TD&gt;900&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e, one file number (200) for customer 1 has been removed because the Report Date is greater than the End&amp;nbsp; Date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Help on this would be really helpful.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/50135"&gt;@vamsee&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22381"&gt;@Miguel_Angel_Baeyens&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance !&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:03:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739238#M721256</guid>
      <dc:creator>vmurugananthan</dc:creator>
      <dc:date>2024-11-16T00:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Match using Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739396#M721257</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/118234"&gt;@vmurugananthan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If I understod correctly , one solution :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data:

LOAD * INLINE [
    CustomerNumber, Start Date, End Date
    1, 01-01-2010, 20-08-2020
    2, 01-01-2010, 01-01-2030
    3, 01-01-2010, 01-01-2030
    6, 01-01-2010, 01-01-2030
    7, 01-01-2010, 01-01-2030
];


left join

LOAD * INLINE [
    CustomerNumber, Report Date, FileNumber
    1, 10-01-2020, 100
    1, 31-08-2020, 200
    2, 02-02-2020, 300
    3, 20-02-2020, 400
    3, 27-03-2020, 500
    4, 04-04-2020, 600
    5, 05-05-2020, 700
    6, 06-06-2020, 800
    7, 07-06-2020, 900
    8, 07-07-2020, 1000
    9, 24-08-2020, 1100
    10, 27-08-2020, 1200
] ;


Final:
noconcatenate

load * resident Data where [Report Date]&amp;lt;=[End Date];

drop table Data;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 748px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/39716i8CD4EF175CDC792D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 08:35:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739396#M721257</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-08-28T08:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Match using Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739401#M721258</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I found the Answer myself. I had used extended interval match. Something like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Left Join (MasterData)&lt;/P&gt;&lt;P&gt;IntervalMatch(ReportDate, CustomerNumber)&lt;/P&gt;&lt;P&gt;Load StartDate,&lt;/P&gt;&lt;P&gt;EndDate,&lt;/P&gt;&lt;P&gt;CustomerNumber&lt;/P&gt;&lt;P&gt;Resident PriorityDataset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Left Join (Master Data)&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;'1' as PriorityIndicator&lt;/P&gt;&lt;P&gt;Resident PriorityDataset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works for me. Thus closing this question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 08:40:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739401#M721258</guid>
      <dc:creator>vmurugananthan</dc:creator>
      <dc:date>2020-08-28T08:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Match using Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739402#M721259</link>
      <description>&lt;P&gt;This would remove all the other Customers right ? But i have 2 views where i show the priority customers and in another i show all customers&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 08:44:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739402#M721259</guid>
      <dc:creator>vmurugananthan</dc:creator>
      <dc:date>2020-08-28T08:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Interval Match using Dates</title>
      <link>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739438#M721260</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/118234"&gt;@vmurugananthan&lt;/a&gt;you can add a Flaglike :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Data:

LOAD * INLINE [
    CustomerNumber, Start Date, End Date
    1, 01-01-2010, 20-08-2020
    2, 01-01-2010, 01-01-2030
    3, 01-01-2010, 01-01-2030
    6, 01-01-2010, 01-01-2030
    7, 01-01-2010, 01-01-2030
];


left join

LOAD * INLINE [
    CustomerNumber, Report Date, FileNumber
    1, 10-01-2020, 100
    1, 31-08-2020, 200
    2, 02-02-2020, 300
    3, 20-02-2020, 400
    3, 27-03-2020, 500
    4, 04-04-2020, 600
    5, 05-05-2020, 700
    6, 06-06-2020, 800
    7, 07-06-2020, 900
    8, 07-07-2020, 1000
    9, 24-08-2020, 1100
    10, 27-08-2020, 1200
] ;


Final:
noconcatenate

load *,if([Report Date]&amp;lt;=[End Date],1,0) as Flag resident Data;

drop table Data;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and you can use flag as list :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Taoufiq_ZARRA_0-1598612645810.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/39723i9DCEE2EEF56C4A1C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Taoufiq_ZARRA_0-1598612645810.png" alt="Taoufiq_ZARRA_0-1598612645810.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Taoufiq_ZARRA_1-1598612661495.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/39724i25AD12D6600B1769/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Taoufiq_ZARRA_1-1598612661495.png" alt="Taoufiq_ZARRA_1-1598612661495.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or by Set analysis : {&amp;lt;Flag={1}&amp;gt;}&amp;nbsp; to show the priority customers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Aug 2020 11:05:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Interval-Match-using-Dates/m-p/1739438#M721260</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-08-28T11:05:38Z</dc:date>
    </item>
  </channel>
</rss>

