<?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 Return value based on match/intervalmatch? (newbie question) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Return-value-based-on-match-intervalmatch-newbie-question/m-p/174014#M42991</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This probably isn't the most efficient approach, but it does the job:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;SET DateFormat='M/D/YYYY';&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Periods:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID,StartDate,EndDate&lt;BR /&gt;1,1/1/2007,12/31/2007&lt;BR /&gt;2,1/1/2008,12/31/2008&lt;BR /&gt;3,1/1/2009,12/31/2009&lt;BR /&gt;];&lt;BR /&gt;Dates:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Date, Field1, Field2&lt;BR /&gt;7/31/2007,A,B&lt;BR /&gt;6/30/2007,C,D&lt;BR /&gt;5/1/2008 ,E,F&lt;BR /&gt;9/14/2009,G,H&lt;BR /&gt;];&lt;BR /&gt;LEFT JOIN ([Dates])&lt;BR /&gt;INTERVALMATCH (Date)&lt;BR /&gt;LOAD&lt;BR /&gt; StartDate&lt;BR /&gt;,EndDate&lt;BR /&gt;RESIDENT [Periods]&lt;BR /&gt;;&lt;BR /&gt;LEFT JOIN ([Dates])&lt;BR /&gt;LOAD&lt;BR /&gt; StartDate&lt;BR /&gt;,EndDate&lt;BR /&gt;,ID&lt;BR /&gt;RESIDENT [Periods]&lt;BR /&gt;;&lt;BR /&gt;DROP TABLE [Periods]&lt;BR /&gt;;&lt;BR /&gt;DROP FIELDS&lt;BR /&gt; StartDate&lt;BR /&gt;,EndDate&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Sep 2009 06:07:53 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2009-09-03T06:07:53Z</dc:date>
    <item>
      <title>Return value based on match/intervalmatch? (newbie question)</title>
      <link>https://community.qlik.com/t5/QlikView/Return-value-based-on-match-intervalmatch-newbie-question/m-p/174013#M42990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to pull an ID value out of a lookup table based on a matching input from another table. Consider the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Periods:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID, StartDate, EndDate&lt;BR /&gt;1, '1/1/2007', '12/31/2007'&lt;BR /&gt;2, '1/1/2008', '12/31/2008'&lt;BR /&gt;3, '1/1/2009', '12/31/2009'&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;Dates:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Date&lt;BR /&gt;'7/31/2007'&lt;BR /&gt;'6/30/2007'&lt;BR /&gt;'5/1/2008'&lt;BR /&gt;'9/14/2009'&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I want to evaluate the range that each Date from the Dates table falls into within the StartDate &amp;amp; EndDate in the Periods table. I have successfully done this with the intervalmatch function. But, what I really want is to return the ID field after I've done that comparison so I can append the ID field to the Date table. (I've simplified this example - Dates would have many other columns. I want to end up with ID in the Dates table and drop the Date field.&lt;/P&gt;&lt;P&gt;My resulting table would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Dates:&lt;BR /&gt;1&lt;BR /&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Thanks in advance for your advice.&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 02:43:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-value-based-on-match-intervalmatch-newbie-question/m-p/174013#M42990</guid>
      <dc:creator />
      <dc:date>2009-09-03T02:43:19Z</dc:date>
    </item>
    <item>
      <title>Return value based on match/intervalmatch? (newbie question)</title>
      <link>https://community.qlik.com/t5/QlikView/Return-value-based-on-match-intervalmatch-newbie-question/m-p/174014#M42991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This probably isn't the most efficient approach, but it does the job:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;SET DateFormat='M/D/YYYY';&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Periods:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;ID,StartDate,EndDate&lt;BR /&gt;1,1/1/2007,12/31/2007&lt;BR /&gt;2,1/1/2008,12/31/2008&lt;BR /&gt;3,1/1/2009,12/31/2009&lt;BR /&gt;];&lt;BR /&gt;Dates:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Date, Field1, Field2&lt;BR /&gt;7/31/2007,A,B&lt;BR /&gt;6/30/2007,C,D&lt;BR /&gt;5/1/2008 ,E,F&lt;BR /&gt;9/14/2009,G,H&lt;BR /&gt;];&lt;BR /&gt;LEFT JOIN ([Dates])&lt;BR /&gt;INTERVALMATCH (Date)&lt;BR /&gt;LOAD&lt;BR /&gt; StartDate&lt;BR /&gt;,EndDate&lt;BR /&gt;RESIDENT [Periods]&lt;BR /&gt;;&lt;BR /&gt;LEFT JOIN ([Dates])&lt;BR /&gt;LOAD&lt;BR /&gt; StartDate&lt;BR /&gt;,EndDate&lt;BR /&gt;,ID&lt;BR /&gt;RESIDENT [Periods]&lt;BR /&gt;;&lt;BR /&gt;DROP TABLE [Periods]&lt;BR /&gt;;&lt;BR /&gt;DROP FIELDS&lt;BR /&gt; StartDate&lt;BR /&gt;,EndDate&lt;BR /&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 06:07:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Return-value-based-on-match-intervalmatch-newbie-question/m-p/174014#M42991</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-09-03T06:07:53Z</dc:date>
    </item>
  </channel>
</rss>

