<?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 Problem with picking the previous process in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-picking-the-previous-process-in-script/m-p/530560#M198352</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 want to calculate the days between operations in an order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table contains multiple Orders with each multiple operations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I use in the first step:&lt;/P&gt;&lt;P&gt;[Start Operation] - peek([End Operation],-1)) AS [DaysWaiting]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Until this point it works pretty well. But the first operation takes the End Date from the last operation of the previous order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix this I thought it could be done with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(%ORDER = previous(%ORDER),[Start Operation] - peek([End Operation],-1), null()) AS [DaysWaiting]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it totally messes up the dates :-/. The table is sorted by Order, Operation ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody a clue what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Nov 2013 10:19:07 GMT</pubDate>
    <dc:creator>peschu123</dc:creator>
    <dc:date>2013-11-15T10:19:07Z</dc:date>
    <item>
      <title>Problem with picking the previous process in script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-picking-the-previous-process-in-script/m-p/530560#M198352</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 want to calculate the days between operations in an order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table contains multiple Orders with each multiple operations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I use in the first step:&lt;/P&gt;&lt;P&gt;[Start Operation] - peek([End Operation],-1)) AS [DaysWaiting]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Until this point it works pretty well. But the first operation takes the End Date from the last operation of the previous order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fix this I thought it could be done with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(%ORDER = previous(%ORDER),[Start Operation] - peek([End Operation],-1), null()) AS [DaysWaiting]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it totally messes up the dates :-/. The table is sorted by Order, Operation ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anybody a clue what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 10:19:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-picking-the-previous-process-in-script/m-p/530560#M198352</guid>
      <dc:creator>peschu123</dc:creator>
      <dc:date>2013-11-15T10:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with picking the previous process in script</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-picking-the-previous-process-in-script/m-p/530561#M198353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had to do a resident load of the same table with "Order By ..." and now it works...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 11:43:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-picking-the-previous-process-in-script/m-p/530561#M198353</guid>
      <dc:creator>peschu123</dc:creator>
      <dc:date>2013-11-15T11:43:29Z</dc:date>
    </item>
  </channel>
</rss>

