<?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: order by issue when using intervalmatch in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/order-by-issue-when-using-intervalmatch/m-p/473686#M689284</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13835018238411305" jivemacro_uid="_13835018238411305" modifiedtitle="true"&gt;
&lt;P&gt;IntervalMatch: // &amp;lt;-- meaningless since the result is joined to Tmp&lt;/P&gt;
&lt;P&gt;left join(Tmp)&lt;/P&gt;
&lt;P&gt;IntervalMatch (datum.KEY)&lt;/P&gt;
&lt;P&gt;Load distinct startdate, endDate resident Tmp&lt;/P&gt;
&lt;P&gt;Order by startdate; // &amp;lt;-- doesn't do anything because of the join&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you join it with Tmp the order by clause is meaningless. If you want to reorder Tmp to calculate PreviousStartdate and PreviousNumberofDays then you need to do that afterwards:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13835019887256540" jivemacro_uid="_13835019887256540"&gt;
&lt;P&gt;x:&lt;/P&gt;
&lt;P&gt;NoConcatenate LOAD&lt;/P&gt;
&lt;P&gt;*,&lt;/P&gt;
&lt;P&gt;Peek(startdate,-1) as PreviousStartdate,&lt;/P&gt;
&lt;P&gt;peek(numberofdays,-1) as PreviousNumberofDays&lt;/P&gt;
&lt;P&gt;Resident Tmp&lt;/P&gt;
&lt;P&gt;order by startdate;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;drop table Tmp;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 03 Nov 2013 18:08:55 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-11-03T18:08:55Z</dc:date>
    <item>
      <title>order by issue when using intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/order-by-issue-when-using-intervalmatch/m-p/473685#M689283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a problem with the 'order by' when I use the interval match function.&lt;/P&gt;&lt;P&gt;I've created a script that peeks to the previous date of an employee that called called sick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However after using the interval match function the Order by seem not to be working right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other problem is that when I peek to the previous date of an employee, it doesn't work 100%. &lt;/P&gt;&lt;P&gt;For example if I look at the first record it can't peek to the previous loaded record, since there is no previous date available before the first date some one called sick, so null should be returned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please look at my script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope some one can help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Nov 2013 10:33:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/order-by-issue-when-using-intervalmatch/m-p/473685#M689283</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-11-03T10:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: order by issue when using intervalmatch</title>
      <link>https://community.qlik.com/t5/QlikView/order-by-issue-when-using-intervalmatch/m-p/473686#M689284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13835018238411305" jivemacro_uid="_13835018238411305" modifiedtitle="true"&gt;
&lt;P&gt;IntervalMatch: // &amp;lt;-- meaningless since the result is joined to Tmp&lt;/P&gt;
&lt;P&gt;left join(Tmp)&lt;/P&gt;
&lt;P&gt;IntervalMatch (datum.KEY)&lt;/P&gt;
&lt;P&gt;Load distinct startdate, endDate resident Tmp&lt;/P&gt;
&lt;P&gt;Order by startdate; // &amp;lt;-- doesn't do anything because of the join&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you join it with Tmp the order by clause is meaningless. If you want to reorder Tmp to calculate PreviousStartdate and PreviousNumberofDays then you need to do that afterwards:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13835019887256540" jivemacro_uid="_13835019887256540"&gt;
&lt;P&gt;x:&lt;/P&gt;
&lt;P&gt;NoConcatenate LOAD&lt;/P&gt;
&lt;P&gt;*,&lt;/P&gt;
&lt;P&gt;Peek(startdate,-1) as PreviousStartdate,&lt;/P&gt;
&lt;P&gt;peek(numberofdays,-1) as PreviousNumberofDays&lt;/P&gt;
&lt;P&gt;Resident Tmp&lt;/P&gt;
&lt;P&gt;order by startdate;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;drop table Tmp;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Nov 2013 18:08:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/order-by-issue-when-using-intervalmatch/m-p/473686#M689284</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-11-03T18:08:55Z</dc:date>
    </item>
  </channel>
</rss>

