<?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 Peek/order by problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453280#M700204</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am struggling to udnerstand why the peek function is not working correctly for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following code to ascertain if two consecutive rows have a flag, and if so populate a row:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;BR /&gt;if(EmailFlag = '1', if(peek(PlanFlag) = EmailFlag and peek(OpCode) = OpCode and peek(account) = account,'Email Sent','Email Not Sent'),'') as EmailSentFlag&lt;/P&gt;&lt;P&gt;Resident DebttransMO&lt;/P&gt;&lt;P&gt;Order by account,OpCode, date,time desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The strange thing is that for some records it works fine - however for others it does not. As you can see from the below, there are 3 occasions where both flags are populated but only one shows Email Sent in the EmailSentFlag column despite the same conditions being met.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="27073" class="jive-image-thumbnail jive-image" height="200" onclick="" alt="SShot.png" src="https://community.qlik.com/legacyfs/online/27073_SShot.png" width="623" /&gt; &lt;/P&gt;&lt;P&gt;Can anyone help exaplin this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Dec 2012 15:38:21 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-19T15:38:21Z</dc:date>
    <item>
      <title>Peek/order by problem</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453280#M700204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am struggling to udnerstand why the peek function is not working correctly for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following code to ascertain if two consecutive rows have a flag, and if so populate a row:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;BR /&gt;if(EmailFlag = '1', if(peek(PlanFlag) = EmailFlag and peek(OpCode) = OpCode and peek(account) = account,'Email Sent','Email Not Sent'),'') as EmailSentFlag&lt;/P&gt;&lt;P&gt;Resident DebttransMO&lt;/P&gt;&lt;P&gt;Order by account,OpCode, date,time desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The strange thing is that for some records it works fine - however for others it does not. As you can see from the below, there are 3 occasions where both flags are populated but only one shows Email Sent in the EmailSentFlag column despite the same conditions being met.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="27073" class="jive-image-thumbnail jive-image" height="200" onclick="" alt="SShot.png" src="https://community.qlik.com/legacyfs/online/27073_SShot.png" width="623" /&gt; &lt;/P&gt;&lt;P&gt;Can anyone help exaplin this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 15:38:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453280#M700204</guid>
      <dc:creator />
      <dc:date>2012-12-19T15:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: Peek/order by problem</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453281#M700205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No this makes no sense to me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 16:44:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453281#M700205</guid>
      <dc:creator />
      <dc:date>2012-12-19T16:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Peek/order by problem</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453282#M700206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 16:46:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453282#M700206</guid>
      <dc:creator />
      <dc:date>2012-12-19T16:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Peek/order by problem</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453283#M700208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check that the table in the front end you are looking at is sorted in the exact order and direction as in the load script (e.g. by adding a &lt;EM&gt;Recno() as RecID&lt;/EM&gt; in the load and sort by this field in your front end).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I noticed that your date and time fields are showing same values for the records (per case), could that be a problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 17:57:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453283#M700208</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-12-19T17:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Peek/order by problem</title>
      <link>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453284#M700212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've used the recno() function and it seems although some sections of the data are ordered correctly others aren't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My fact table comprises of 3 concatenations - do I need to order each of these individually or just at the final resident load?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 10:12:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Peek-order-by-problem/m-p/453284#M700212</guid>
      <dc:creator />
      <dc:date>2012-12-20T10:12:31Z</dc:date>
    </item>
  </channel>
</rss>

