<?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: Subtract next row with the current row ?? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236504#M24409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use Peek(), but Peek() can only address rows already read in, not rows that are located in following records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can change the sort order of your table to overcome this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;INPUT:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD id_pk, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Result Column(HH:MM:SS)], &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Status id], &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; update_date_time&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2156" data-containertype="14" data-objectid="241212" data-objecttype="1" href="https://community.qlik.com/thread/241212"&gt;https://community.qlik.com/thread/241212&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Result:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;STRONG&gt; If(Peek('Status id') = 4 and [Status id] = 4,interval(Peek('update_date_time')- update_date_time )) as test&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident INPUT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;order by id_pk desc;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP TABLE INPUT;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2016 17:41:10 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-11-28T17:41:10Z</dc:date>
    <item>
      <title>Subtract next row with the current row ??</title>
      <link>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236500#M24405</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;&lt;STRONG&gt;in the following table&amp;nbsp; where the Status_id = 4 i have to calculate the Result Cloumn by subtracting the update_date_time &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;highlighted in &lt;/STRONG&gt;&lt;STRONG&gt;Orange-&amp;nbsp; &lt;STRONG style="font-size: 13.3333px;"&gt;update_date_time in &lt;/STRONG&gt;Green in HH:MM:SS &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="1px" cellpadding="0" cellspacing="0" height="207" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="border-width: 1px; border-style: solid; width: 730px; height: 209px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: rgb(255, 255, 255); background-color: rgb(102, 144, 188); text-align: center; padding: 2px;"&gt;id_pk&lt;/TH&gt;&lt;TH style="color: rgb(255, 255, 255); background-color: rgb(102, 144, 188); text-align: center; padding: 2px;"&gt;Result Column(HH:MM:SS)&lt;/TH&gt;&lt;TH style="color: rgb(255, 255, 255); background-color: rgb(102, 144, 188); text-align: center; padding: 2px;"&gt;Status id&lt;/TH&gt;&lt;TH style="color: rgb(255, 255, 255); background-color: rgb(102, 144, 188); text-align: center; padding: 2px;"&gt;update_date_time&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="17" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;56327&lt;/TD&gt;&lt;TD class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl67" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;2016-07-26 11:47:36&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="17" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;56328&lt;/TD&gt;&lt;TD class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl67" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;2016-07-26 11:47:59&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="17" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;56330&lt;/TD&gt;&lt;TD class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl67" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;2016-07-26 11:48:30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="17" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;56331&lt;/TD&gt;&lt;TD class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;SPAN style="color: #ff6600; font-size: 18.6667px; text-align: center;"&gt;2016-07-26 11:49:29 - &lt;SPAN style="color: #339966; font-size: 18.6667px; text-align: center;"&gt;2016-07-26 11:48:41=&lt;SPAN style="color: #0000ff;"&gt;00:00:48&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl68" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;SPAN style="color: #575757;"&gt;&lt;STRONG style="font-size: 14pt;"&gt;4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl69" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;SPAN style="color: #339966; font-size: 14pt;"&gt;2016-07-26 11:48:41&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="17" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;56332&lt;/TD&gt;&lt;TD class="xl71" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl68" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl70" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;SPAN style="color: #ff6600; font-size: 14pt;"&gt;2016-07-26 11:49:29&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="17" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;56334&lt;/TD&gt;&lt;TD class="xl73" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl72" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;2016-07-26 11:51:20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="17" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;/TD&gt;&lt;TD class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl66" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl67" style="color: rgb(87, 87, 87); text-align: center; background-color: rgba(0, 0, 0, 0); font-family: arial, helvetica, sans-serif; vertical-align: baseline;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 12:43:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236500#M24405</guid>
      <dc:creator>gauravgg</dc:creator>
      <dc:date>2016-11-28T12:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract next row with the current row ??</title>
      <link>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236501#M24406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd use Peek() in load script. &lt;A href="https://help.qlik.com/en-US/sense/3.1/Subsystems/Hub/Content/Scripting/InterRecordFunctions/Peek.htm" title="https://help.qlik.com/en-US/sense/3.1/Subsystems/Hub/Content/Scripting/InterRecordFunctions/Peek.htm"&gt;Peek()&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 12:50:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236501#M24406</guid>
      <dc:creator />
      <dc:date>2016-11-28T12:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract next row with the current row ??</title>
      <link>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236502#M24407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u show with example...or share qvf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 17:15:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236502#M24407</guid>
      <dc:creator>gauravgg</dc:creator>
      <dc:date>2016-11-28T17:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract next row with the current row ??</title>
      <link>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236503#M24408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the below() function. Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Status_id=4, below(update_date_time) - update_date_time, '')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow" target="_blank"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow" target="_blank"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 17:40:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236503#M24408</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2016-11-28T17:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract next row with the current row ??</title>
      <link>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236504#M24409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use Peek(), but Peek() can only address rows already read in, not rows that are located in following records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can change the sort order of your table to overcome this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;INPUT:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD id_pk, &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Result Column(HH:MM:SS)], &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Status id], &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; update_date_time&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2156" data-containertype="14" data-objectid="241212" data-objecttype="1" href="https://community.qlik.com/thread/241212"&gt;https://community.qlik.com/thread/241212&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(html, codepage is 1252, embedded labels, table is @1);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Result:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD *,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt; &lt;STRONG&gt; If(Peek('Status id') = 4 and [Status id] = 4,interval(Peek('update_date_time')- update_date_time )) as test&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident INPUT&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;order by id_pk desc;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP TABLE INPUT;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 17:41:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Subtract-next-row-with-the-current-row/m-p/1236504#M24409</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-11-28T17:41:10Z</dc:date>
    </item>
  </channel>
</rss>

