<?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 IntervalMatch Excluding Duplicate Values in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/IntervalMatch-Excluding-Duplicate-Values/m-p/1679524#M51685</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;Here is a simplified version of what I am trying to accomplish. I've borrowed the template from the user manual and modified it slightly as what I'm doing is very similar.&lt;BR /&gt;&lt;BR /&gt;[Time Table A]:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Alert_Time, ID&lt;BR /&gt;01:00, 1&lt;BR /&gt;01:00, 2&lt;BR /&gt;01:18, 3&lt;BR /&gt;02:12, 4&lt;BR /&gt;02:23, 5&lt;BR /&gt;02:23, 6&lt;BR /&gt;02:23, 7&lt;BR /&gt;04:15, 8&lt;BR /&gt;08:00, 9&lt;BR /&gt;09:00, 10&lt;BR /&gt;11:43, 11&lt;BR /&gt;11:43, 12&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;[Time Table B]:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Start_Time, End_Time&lt;BR /&gt;01:00, 03:00&lt;BR /&gt;03:00, 07:00&lt;BR /&gt;07:00, 10:00&lt;BR /&gt;10:00, 11:45&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Inner Join IntervalMatch (Alert_Time)&lt;BR /&gt;LOAD Start_Time, End_Time&lt;BR /&gt;Resident [Time Table B];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the user manual, when I do this, I should have an additional column in my Time Table B with all the matching Alert_Time fields. However, when I perform this, it only partially works - as the new column that gets added has all the corresponding values, but &lt;STRONG&gt;no duplicates&lt;/STRONG&gt;.&amp;nbsp; As a result,&amp;nbsp; instead of having 12 rows of data in Table B, I have only 8.&lt;/P&gt;&lt;P&gt;When I try adding the ID as a key to the IntervalMatch function, such as ...&lt;/P&gt;&lt;P&gt;Inner Join IntervalMatch (Alert_Time, ID)&lt;BR /&gt;LOAD Start_Time, End_Time, ID&lt;BR /&gt;Resident [Time Table B];&lt;/P&gt;&lt;P&gt;The resulting table is then empty, and contains no rows of data.&lt;BR /&gt;This is baffling me as, I have copied the user manual's example of using a keyfield along with the IntervalMatch function, and it works properly there.&lt;BR /&gt;(&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/September2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/IntervalMatch.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/sense/September2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/IntervalMatch.htm&lt;/A&gt;&amp;nbsp;)&lt;BR /&gt;(Example 2 in the link above)&lt;/P&gt;&lt;P&gt;Any clues on how to get the duplicate values of Alert_Time into [Time Table B]? I have seen other questions online asking how to get rid of duplicate rows upon using IntervalMatch, but no posts with the opposite issue.&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 19:02:16 GMT</pubDate>
    <dc:creator>PetitFoulard</dc:creator>
    <dc:date>2024-11-16T19:02:16Z</dc:date>
    <item>
      <title>IntervalMatch Excluding Duplicate Values</title>
      <link>https://community.qlik.com/t5/App-Development/IntervalMatch-Excluding-Duplicate-Values/m-p/1679524#M51685</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;Here is a simplified version of what I am trying to accomplish. I've borrowed the template from the user manual and modified it slightly as what I'm doing is very similar.&lt;BR /&gt;&lt;BR /&gt;[Time Table A]:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Alert_Time, ID&lt;BR /&gt;01:00, 1&lt;BR /&gt;01:00, 2&lt;BR /&gt;01:18, 3&lt;BR /&gt;02:12, 4&lt;BR /&gt;02:23, 5&lt;BR /&gt;02:23, 6&lt;BR /&gt;02:23, 7&lt;BR /&gt;04:15, 8&lt;BR /&gt;08:00, 9&lt;BR /&gt;09:00, 10&lt;BR /&gt;11:43, 11&lt;BR /&gt;11:43, 12&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;[Time Table B]:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Start_Time, End_Time&lt;BR /&gt;01:00, 03:00&lt;BR /&gt;03:00, 07:00&lt;BR /&gt;07:00, 10:00&lt;BR /&gt;10:00, 11:45&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Inner Join IntervalMatch (Alert_Time)&lt;BR /&gt;LOAD Start_Time, End_Time&lt;BR /&gt;Resident [Time Table B];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the user manual, when I do this, I should have an additional column in my Time Table B with all the matching Alert_Time fields. However, when I perform this, it only partially works - as the new column that gets added has all the corresponding values, but &lt;STRONG&gt;no duplicates&lt;/STRONG&gt;.&amp;nbsp; As a result,&amp;nbsp; instead of having 12 rows of data in Table B, I have only 8.&lt;/P&gt;&lt;P&gt;When I try adding the ID as a key to the IntervalMatch function, such as ...&lt;/P&gt;&lt;P&gt;Inner Join IntervalMatch (Alert_Time, ID)&lt;BR /&gt;LOAD Start_Time, End_Time, ID&lt;BR /&gt;Resident [Time Table B];&lt;/P&gt;&lt;P&gt;The resulting table is then empty, and contains no rows of data.&lt;BR /&gt;This is baffling me as, I have copied the user manual's example of using a keyfield along with the IntervalMatch function, and it works properly there.&lt;BR /&gt;(&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/September2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/IntervalMatch.htm" target="_blank" rel="noopener"&gt;https://help.qlik.com/en-US/sense/September2019/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefixes/IntervalMatch.htm&lt;/A&gt;&amp;nbsp;)&lt;BR /&gt;(Example 2 in the link above)&lt;/P&gt;&lt;P&gt;Any clues on how to get the duplicate values of Alert_Time into [Time Table B]? I have seen other questions online asking how to get rid of duplicate rows upon using IntervalMatch, but no posts with the opposite issue.&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:02:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IntervalMatch-Excluding-Duplicate-Values/m-p/1679524#M51685</guid>
      <dc:creator>PetitFoulard</dc:creator>
      <dc:date>2024-11-16T19:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch Excluding Duplicate Values</title>
      <link>https://community.qlik.com/t5/App-Development/IntervalMatch-Excluding-Duplicate-Values/m-p/1679535#M51687</link>
      <description>&lt;P&gt;I can see many problems in your data:&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;timestamp 00:00&lt;/P&gt;&lt;P&gt;but there is no interval that includes 00:00 ?&lt;/P&gt;&lt;P&gt;next:&lt;/P&gt;&lt;P&gt;interval 1 from 01:00 to 03.35 and&lt;/P&gt;&lt;P&gt;interval 2 from 02:30 to 07:58&lt;/P&gt;&lt;P&gt;so there is a multi-link time from 02:30 to 3:35&lt;/P&gt;&lt;P&gt;Clean your datas so that is only &lt;U&gt;ONE&lt;/U&gt; possible interval for all timestmaps and include all timestamps into interval.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 15:21:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IntervalMatch-Excluding-Duplicate-Values/m-p/1679535#M51687</guid>
      <dc:creator>martinpohl</dc:creator>
      <dc:date>2020-02-26T15:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch Excluding Duplicate Values</title>
      <link>https://community.qlik.com/t5/App-Development/IntervalMatch-Excluding-Duplicate-Values/m-p/1679537#M51688</link>
      <description>&lt;P&gt;Hi Martinpohl,&lt;/P&gt;&lt;P&gt;Thanks very much for taking a look. You are absolutely right, there are some problems in the data posted above. I had slightly modified an example from the user's manual to showcase my current issue. I did not see that these problems existed in the user's manual! I assure you that the tables I am using for the IntervalMatch are a bit cleaner. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I will edit the post accordingly as to not confuse anyone else. Cheers and thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 15:31:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IntervalMatch-Excluding-Duplicate-Values/m-p/1679537#M51688</guid>
      <dc:creator>PetitFoulard</dc:creator>
      <dc:date>2020-02-26T15:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch Excluding Duplicate Values</title>
      <link>https://community.qlik.com/t5/App-Development/IntervalMatch-Excluding-Duplicate-Values/m-p/1681352#M51841</link>
      <description>&lt;P&gt;In case this helps someone in the future:&lt;/P&gt;&lt;P&gt;As far as I could find, there were no examples online of someone using &lt;STRONG&gt;IntervalMatch&lt;/STRONG&gt; and getting it to keep the duplicates of the &lt;STRONG&gt;MATCHFIELD&lt;/STRONG&gt; value being passed in.&lt;/P&gt;&lt;P&gt;As I understand it, &lt;STRONG&gt;IntervalMatch&lt;/STRONG&gt; will treat the &lt;STRONG&gt;MATCHFIELD&lt;/STRONG&gt; as a primary key for the new table that the function creates. However this isn't necessary when using &lt;STRONG&gt;IntervalMatch&lt;/STRONG&gt; with an &lt;STRONG&gt;Inner Join&lt;/STRONG&gt; preceeding it.&lt;/P&gt;&lt;P&gt;For example, if we had the data below:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[Retirement]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load * INLINE [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ID, Employee, RetirementDate&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;1, John, 2020-05-01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2, Veronica, 2020-05-01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;3, Sam, 2020-04-03&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;4, Olivia, 2020-04-03&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;5, Jeff, 2020-07-15&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;6, Ashley, 2020-07-15&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;7, Porter, 2020-10-05&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;8, Leon, 2020-10-05&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;9, Gabbie,&amp;nbsp;2020-11-06&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[RetirementYearQuarter]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load * INLINE [&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Quarter, QuarterStart, QuarterEnd&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Q1, 2020-01-01, 2020-04-01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Q2, 2020-04-02, 2020-07-01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Q3, 2020-07-02, 2020-10-01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Q4, 2020-10-02, 2020-12-31&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I was using &lt;STRONG&gt;IntervalMatch&lt;/STRONG&gt; on the two tables above to get a corresponding table of every person's retirement date and which quarter they were going to retire in, the resulting table would not hold any duplicates of retirement dates. Something like ...&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Inner Join IntervalMatch (RetirementDate)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load QuarterStart, QuarterEnd&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident RetirementYearQuarter;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;... Would yield the following result:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[RetirementYearQuarter]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;RetirementDate, Quarter, QuarterStart, QuarterEnd&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2020-05-01, Q2, 2020-04-02, 2020-07-01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2020-04-03, Q2, 2020-04-02, 2020-07-01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2020-07-15, Q3, 2020-07-02, 2020-10-01&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2020-10-05, Q4, 2020-10-02, 2020-12-31&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;2020-11-06, Q4, 2020-10-02, 2020-12-31&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;(Funny how everyone seems to be retiring at the same time!) Ultimately what I am trying to accomplish is placing the quarter (Q1, Q2, Q3, Q4) next to the corresponding data in the &lt;STRONG&gt;Retirement&lt;/STRONG&gt; table. Since I do not have an ID in the &lt;STRONG&gt;RetirementYearQuarter&lt;/STRONG&gt; table to match with the &lt;STRONG&gt;Retirement&lt;/STRONG&gt; table, this process becomes slightly more difficult. I tried to use the &lt;STRONG&gt;Quarter&lt;/STRONG&gt; column as a keyfield in my interval match (Example:)&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Inner Join IntervalMatch (RetirementDate, Quarter)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Load QuarterStart, QuarterEnd, Quarter&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident RetirementYearQuarter&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But that created a table with 0 rows of data (no surprise).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Solution: &lt;/U&gt;(Hopefully this will help anyone else who wanders here in the future)&lt;/P&gt;&lt;P&gt;When life gives you lemons ... I took the newly modified &lt;STRONG&gt;RetirementYearQuarter&lt;/STRONG&gt; table and used it as a reference for my &lt;STRONG&gt;Retirement&lt;/STRONG&gt; table. By doing a &lt;STRONG&gt;Left Join&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Left Join (Retirement) Load&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;RetirementDate,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Quarter&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Resident RetirementYearQuarter;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I was then able to use the &lt;STRONG&gt;RetirementDate&lt;/STRONG&gt; value to re-assign the &lt;STRONG&gt;Quarter&lt;/STRONG&gt; column to its appropriate values. Looking at it here, detailed and laid out, it seems very simple, but sometimes the simplest problems can be complex when we stick our noses to close to the screen to see properly. Woops!&lt;/P&gt;&lt;P&gt;Cheers and best of luck all.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 14:53:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IntervalMatch-Excluding-Duplicate-Values/m-p/1681352#M51841</guid>
      <dc:creator>PetitFoulard</dc:creator>
      <dc:date>2020-03-03T14:53:08Z</dc:date>
    </item>
  </channel>
</rss>

