<?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: dates intervalmatch with inline in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/dates-intervalmatch-with-inline/m-p/1880668#M72575</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146877"&gt;@Andrei_Cusnir&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Many thanks for your great reply. That's indeed what I was looking for. It works perfectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I actually had already tried a WHERE Clause but didn't figure out how to do it within a range, that's why i came up with the idea of an interval match, which is far more complex.&lt;/P&gt;
&lt;P&gt;Thanks again for the support&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jan 2022 12:31:07 GMT</pubDate>
    <dc:creator>charlie2</dc:creator>
    <dc:date>2022-01-13T12:31:07Z</dc:date>
    <item>
      <title>dates intervalmatch with inline</title>
      <link>https://community.qlik.com/t5/App-Development/dates-intervalmatch-with-inline/m-p/1880076#M72540</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a table with sales on a daily basis and I would like in the data script to filter these by the last 365 days. I tried this with an interval match but somehow doesn't work and i can't really tell why.&lt;/P&gt;
&lt;P&gt;Here my tables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First table where I generate the interval:&lt;/P&gt;
&lt;P&gt;Time:&lt;BR /&gt;LET vDatumMin = Date(today()-365);&lt;BR /&gt;LET vDatumMax = Date(today()-1);&lt;/P&gt;
&lt;P&gt;LOAD * Inline [&lt;BR /&gt;DatumMin, DatumMax, &lt;BR /&gt;'$(vDatumMin)', '$(vDatumMax)'];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second table with my sales:&lt;/P&gt;
&lt;P&gt;Sales:&lt;/P&gt;
&lt;P&gt;LOAD&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date(Datum) AS Datum,&lt;/P&gt;
&lt;P&gt;Customer,&lt;/P&gt;
&lt;P&gt;Materialcode&lt;/P&gt;
&lt;P&gt;FROM XXX;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I try to do the intervalmatch&lt;/P&gt;
&lt;P&gt;Left Join ([Sales]) IntervalMatch(Datum) &lt;BR /&gt;LOAD $(vDatumMin), $(vDatumMax)&lt;BR /&gt;Resident Time;&lt;BR /&gt;left Join ([Sales]) LOAD * RESIDENT Time;&lt;BR /&gt;DROP TABLE Time;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is quite of a standard procedure but somehow the interval match is not set up. I end up later with all the sales instead of the last 365 days. I'm pretty sure it's a format-related problem but can't find it out.&lt;/P&gt;
&lt;P&gt;Any help is more than appreciated&lt;/P&gt;
&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 13:15:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dates-intervalmatch-with-inline/m-p/1880076#M72540</guid>
      <dc:creator>charlie2</dc:creator>
      <dc:date>2022-01-12T13:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: dates intervalmatch with inline</title>
      <link>https://community.qlik.com/t5/App-Development/dates-intervalmatch-with-inline/m-p/1880565#M72570</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;If my understanding is correct, you would like to load all the records that are not older than &lt;SPAN style="color:#8e44ad"&gt;&lt;STRONG&gt;365 &lt;/STRONG&gt;&lt;/SPAN&gt;days from &lt;SPAN style="color:#8e44ad"&gt;&lt;STRONG&gt;today&lt;/STRONG&gt;&lt;/SPAN&gt;. To do so, you can go with a much simpler solution such as using the &lt;SPAN style="color:#2980b9"&gt;&lt;STRONG&gt;WHERE &lt;/STRONG&gt;&lt;/SPAN&gt;clause in the&lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt; Data load editor&lt;/STRONG&gt;&lt;/SPAN&gt; script. Here are the steps that I have followed to achieve the same outcome:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;1.&amp;nbsp; I have created the following fake dataset:&lt;/P&gt;

&lt;P&gt;&lt;IMG alt="SCREEENSHOT" src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/qlik.response.lithium.com/RESPONSEIMAGE/c227e38b-2312-4136-8604-71ca07dbb4db.default.PNG" /&gt;&lt;/P&gt;

&lt;P&gt;Ignore the &lt;SPAN style="color:#f39c12"&gt;&lt;STRONG&gt;"Days"&lt;/STRONG&gt;&lt;/SPAN&gt; field and the &lt;SPAN style="color:#c0392b"&gt;&lt;STRONG&gt;red &lt;/STRONG&gt;&lt;/SPAN&gt;color,&amp;nbsp;as I have added it to demonstrate which records we want to exclude from our dataset.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;2. In the &lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;Data load editor&lt;/STRONG&gt;&lt;/SPAN&gt; I have added the following script:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color:#8e44ad"&gt;&lt;STRONG&gt;MyData:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;
&lt;SPAN style="color:#2980b9"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;
&lt;SPAN style="color:#e67e22"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; ID,&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; "Date",&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; Amount,&lt;BR /&gt;
&amp;nbsp; &amp;nbsp; "Days"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;
&lt;SPAN style="color:#2980b9"&gt;&lt;STRONG&gt;FROM &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;[...]&lt;BR /&gt;
(...)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;
&lt;SPAN style="color:#2980b9"&gt;&lt;STRONG&gt;WHERE &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#e67e22"&gt;&lt;STRONG&gt;Date &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;&amp;gt; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#2980b9"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#2980b9"&gt;&lt;STRONG&gt;AddYears&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#2980b9"&gt;&lt;STRONG&gt;Today&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;(), &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#8e44ad"&gt;&lt;STRONG&gt;-1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color:#27ae60"&gt;&lt;STRONG&gt;))&lt;BR /&gt;
;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have used the &lt;SPAN style="color:#2980b9"&gt;&lt;STRONG&gt;WHERE &lt;/STRONG&gt;&lt;/SPAN&gt;clause to load all the records where the &lt;SPAN style="color:#f39c12"&gt;&lt;STRONG&gt;Date &lt;/STRONG&gt;&lt;/SPAN&gt;is grater than the current date - 1 year. To achieve that, I have used the &lt;STRONG&gt;&lt;SPAN style="color:#2980b9"&gt;AddYears&lt;/SPAN&gt;()&lt;/STRONG&gt; [1] function and I have passed the values &lt;STRONG&gt;&lt;SPAN style="color:#2980b9"&gt;Today&lt;/SPAN&gt;()&lt;/STRONG&gt; and -1.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;3. This is the outcome that I have:&lt;/P&gt;

&lt;P&gt;&lt;IMG alt="SCREENSHOT" src="https://lithium-response-prod.s3.us-west-2.amazonaws.com/qlik.response.lithium.com/RESPONSEIMAGE/9d2cd8a1-e9b7-4c46-b2f7-6b88b833f45a.default.PNG" /&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;As you can see, only the records where days count is less than &lt;STRONG&gt;365 &lt;/STRONG&gt;are loaded.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="color:#7f8c8d"&gt;&lt;EM&gt;&lt;STRONG&gt;I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members.&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;
&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;---&lt;/P&gt;

&lt;P&gt;[1]&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/addyears.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/DateAndTimeFunctions/addyears.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 10:09:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dates-intervalmatch-with-inline/m-p/1880565#M72570</guid>
      <dc:creator>Andrei_Cusnir</dc:creator>
      <dc:date>2022-01-13T10:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: dates intervalmatch with inline</title>
      <link>https://community.qlik.com/t5/App-Development/dates-intervalmatch-with-inline/m-p/1880668#M72575</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146877"&gt;@Andrei_Cusnir&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Many thanks for your great reply. That's indeed what I was looking for. It works perfectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I actually had already tried a WHERE Clause but didn't figure out how to do it within a range, that's why i came up with the idea of an interval match, which is far more complex.&lt;/P&gt;
&lt;P&gt;Thanks again for the support&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 12:31:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dates-intervalmatch-with-inline/m-p/1880668#M72575</guid>
      <dc:creator>charlie2</dc:creator>
      <dc:date>2022-01-13T12:31:07Z</dc:date>
    </item>
  </channel>
</rss>

