<?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: Preceding load and order by in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666712#M50215</link>
    <description>&lt;P&gt;The issue is caused through the fact that not all relevant fields are included within your last preceding-load - especially the peek-field.&lt;/P&gt;&lt;P&gt;I suggest that you remained by the two-step preceding and then drop the unwanted fields with something like:&lt;/P&gt;&lt;P&gt;drop fields LFinTimeKey, "Job - Counter" from LastFinishedTime;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jan 2020 12:05:57 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2020-01-17T12:05:57Z</dc:date>
    <item>
      <title>Preceding load and order by</title>
      <link>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666619#M50202</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a question regarding preceding load in Qlik Sense.&lt;/P&gt;&lt;P&gt;I am developing an app where one of the goal is to assign each Job (ZWMSJOBSH.JOBID field) correct assigned time and finished time.&lt;/P&gt;&lt;P&gt;In order to achieve this I must break duration of each group of jobs (all jobs which fall in one group have the same "LFinTimeKey") into even fractions and assign each&amp;nbsp;ZWMSJOBSH.JOBID "new"&amp;nbsp;"Dif - Assigned time" and&amp;nbsp;"Dif - Finished time". So the jobs follow one another in the group and Total duration of the group equals to&amp;nbsp;"Finished time"-"Assigned time".&lt;/P&gt;&lt;P&gt;Basically I know how to achieve the desired result but I have encountered an interesting behaviour of preceding load in this case so I would like to know what is the cause for different results as shown below:&lt;/P&gt;&lt;P&gt;EXAMPLE 1 (incorrect result)&lt;/P&gt;&lt;P&gt;LastFinishedTime:&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ZWMSJOBSH.JOBID,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Dif - Assigned time",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Dif - Finished time";&lt;BR /&gt;Load *,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (("Job - Counter" - 1) * "Job - Duration") + "Assigned time" as "Dif - Assigned time",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (("Job - Counter") * "Job - Duration") + "Assigned time" as "Dif - Finished time";&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp; LFinTimeKey,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ZWMSJOBSH.JOBID,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "Assigned time",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "Finished time",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "Jobs count",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ("Finished time"-"Assigned time")/"Jobs count" as "Job - Duration",&amp;nbsp; &amp;nbsp; If(Peek(LFinTimeKey) = LFinTimeKey, Rangesum(Peek("Job - Counter"),1) , 1) as&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Job - Counter"&lt;BR /&gt;Resident LastFinishedTime_tmp&lt;BR /&gt;order by LFinTimeKey;&lt;/P&gt;&lt;P&gt;INCORRECT RESULT:&lt;BR /&gt;ZWMSJOBSH.JOBID Dif - Assigned time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dif - Finished time&lt;BR /&gt;0007493646&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:10:57&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:12:25&lt;BR /&gt;0007493647&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:10:57&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:12:25&lt;BR /&gt;0007493648&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:10:57&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:12:25&lt;/P&gt;&lt;P&gt;EXAMPLE 2 (correct result)&lt;/P&gt;&lt;P&gt;LastFinishedTime:&lt;BR /&gt;Load *,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (("Job - Counter" - 1) * "Job - Duration") + "Assigned time" as "Dif - Assigned time",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; (("Job - Counter") * "Job - Duration") + "Assigned time" as "Dif - Finished time";&lt;BR /&gt;Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp; LFinTimeKey,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ZWMSJOBSH.JOBID,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "Assigned time",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "Finished time",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "Jobs count",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ("Finished time"-"Assigned time")/"Jobs count" as "Job - Duration",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If(Peek(LFinTimeKey) = LFinTimeKey, Rangesum(Peek("Job - Counter"),1) , 1) as "Job - Counter"&lt;BR /&gt;Resident LastFinishedTime_tmp&lt;BR /&gt;order by LFinTimeKey;&lt;/P&gt;&lt;P&gt;CORRECT RESULT:&lt;BR /&gt;ZWMSJOBSH.JOBID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dif - Assigned time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dif - Finished time&lt;BR /&gt;0007493646&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:10:57&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:12:25&lt;BR /&gt;0007493648&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:12:25&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:13:52&lt;BR /&gt;0007493647&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:13:52&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;02.07.2019 00:15:20&lt;/P&gt;&lt;P&gt;The only difference is that in the first example there is one extra preceding load. I guess it has something to do with the different result of Order by when adding another preceding load. But I would like to understand what really happens.&lt;/P&gt;&lt;P&gt;Any help would be appreaciated. Thanks a lot.&lt;/P&gt;&lt;P&gt;Have a great day.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 08:30:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666619#M50202</guid>
      <dc:creator>onmysi49</dc:creator>
      <dc:date>2020-01-17T08:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Preceding load and order by</title>
      <link>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666712#M50215</link>
      <description>&lt;P&gt;The issue is caused through the fact that not all relevant fields are included within your last preceding-load - especially the peek-field.&lt;/P&gt;&lt;P&gt;I suggest that you remained by the two-step preceding and then drop the unwanted fields with something like:&lt;/P&gt;&lt;P&gt;drop fields LFinTimeKey, "Job - Counter" from LastFinishedTime;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 12:05:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666712#M50215</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-01-17T12:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Preceding load and order by</title>
      <link>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666724#M50218</link>
      <description>&lt;P&gt;Hello Marcus,&lt;/P&gt;&lt;P&gt;thanks a lot for a quick reply! That should solve it. I was also able to solve it with replacing this last preceding load with load resident. Your solution is better though.&lt;/P&gt;&lt;P&gt;I just would like to understand how it works "in the background" it means the peek is recalculated in the last preceding load and therefore the result is different from what I expected?&lt;/P&gt;&lt;P&gt;Thanks a lot. Have a good one&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 12:26:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666724#M50218</guid>
      <dc:creator>onmysi49</dc:creator>
      <dc:date>2020-01-17T12:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Preceding load and order by</title>
      <link>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666742#M50220</link>
      <description>&lt;P&gt;Within a preceeding-load it doesn't load the the specified table and applied on this the second/third load and so on - as would it be just another load-syntax for resident-loads - else the first record is taken and then passed through all preceeding-statements. If this is done it comes to the second record and so on.&lt;/P&gt;&lt;P&gt;If you now removed your keep-fields &lt;STRONG&gt;LFinTimeKey, "Job - Counter"&lt;/STRONG&gt; from the last preceeding-step the next records couldn't access them anymore - they are gone. And of course this leads to the unwanted results.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 13:09:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666742#M50220</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2020-01-17T13:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Preceding load and order by</title>
      <link>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666906#M50248</link>
      <description>&lt;P&gt;It is clear now. Well explained!&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;&lt;P&gt;Ondrej&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 19:09:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Preceding-load-and-order-by/m-p/1666906#M50248</guid>
      <dc:creator>onmysi49</dc:creator>
      <dc:date>2020-01-17T19:09:26Z</dc:date>
    </item>
  </channel>
</rss>

