<?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: Substract 2 different rows of a single table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364812#M492106</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Frank its working now for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Feb 2014 09:41:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-17T09:41:17Z</dc:date>
    <item>
      <title>Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364806#M492100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am developing an application in qlikview where I need a formula to substract 2 different rows of a single table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample of the table I am having. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Date: Different dates of a perticular month (here:D1,D2,D3..etc)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Field 1: Field2's Value depends on this column&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Field 2: Its a calculated field, derived from the values of Field 1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="18809" class="jive-image-thumbnail jive-image" onclick="" alt="Untitled.png" src="https://community.qlik.com/legacyfs/online/18809_Untitled.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;The logic for &lt;STRONG&gt;Field 2&lt;/STRONG&gt; is first row will be 0 as it dont have no previous value. The 2nd row will be &lt;STRONG&gt;Value of 2nd Row of Field 1- Value of 1st row of Field 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;i.e: Current row value-previous row value.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help with this? I would prefer to do the calculation in Script rather than putting a formula in a pivot table as the data is too huge and it can take a lot of time to calculate. But if its not possible in script I will go for formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 12:14:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364806#M492100</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-24T12:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364807#M492101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this link &lt;A _jive_internal="true" href="https://community.qlik.com/message/240988#240988"&gt;http://community.qlik.com/message/240988#240988&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 12:25:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364807#M492101</guid>
      <dc:creator>sivarajs</dc:creator>
      <dc:date>2012-07-24T12:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364808#M492102</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;You need something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(RowNo(TOTAL) = 1, 0, Field1 - Above(Field1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 12:29:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364808#M492102</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-07-24T12:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364809#M492103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You Sivaraj &amp;amp; Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This helped to resolve the issue by formula. But is it possible to do with script? Because &lt;STRONG&gt;Above() is not working in script.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error in expression:&lt;BR /&gt;ABOVE is not a valid function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 12:40:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364809#M492103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-07-24T12:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364810#M492104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try the peek function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;If(RowNo() = 1, 0, Field1 - peek(Field1,-1))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;You have to make sure everything is sorted in the right way.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 12:45:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364810#M492104</guid>
      <dc:creator />
      <dc:date>2012-07-24T12:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364811#M492105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually i also have the same issue of subtracting&amp;nbsp; two row of the same table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to do it at the front end level.&lt;/P&gt;&lt;P&gt;And the &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px;"&gt;If(RowNo() = 1, 0, Field1 - peek(Field1,-1)) is not working properly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px;"&gt;Can any body guide me on this?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 09:35:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364811#M492105</guid>
      <dc:creator />
      <dc:date>2014-02-17T09:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364812#M492106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Frank its working now for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 09:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364812#M492106</guid>
      <dc:creator />
      <dc:date>2014-02-17T09:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364813#M492107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Frank,&lt;/P&gt;&lt;P&gt;I am facing the same problem in my development, but i need to subtrct the two row from different columns in the same table.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time 1&amp;nbsp;&amp;nbsp;&amp;nbsp; Time 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&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; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&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; 3&lt;/P&gt;&lt;P&gt;Tatal&amp;nbsp;&amp;nbsp;&amp;nbsp; 9&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; 5&amp;nbsp;&amp;nbsp; =4&amp;nbsp; (9-5)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please suggest how can i write expression for 9-5= 4 and&amp;nbsp; Multply 4 with some other number like 4*9=36.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Bhupal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 06:25:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364813#M492107</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-10T06:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364814#M492108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Text box, &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;=Sum(Time1) - Sum(Time2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Chart,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;=Sum(Total Time1) - Sum(Total Time2)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 06:39:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364814#M492108</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-12-10T06:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364815#M492109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jonathan!!!&lt;/P&gt;&lt;P&gt;That's exactly what I was looking for!!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 14:03:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364815#M492109</guid>
      <dc:creator>linoyel</dc:creator>
      <dc:date>2015-07-02T14:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364816#M492110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to do the same in a KPI ? I want to calculate sum of those differences in a KPI ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 11:04:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/364816#M492110</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-02T11:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Substract 2 different rows of a single table</title>
      <link>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/1553432#M492111</link>
      <description>&lt;P&gt;Thanks a lot, worked perfect!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 09:33:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substract-2-different-rows-of-a-single-table/m-p/1553432#M492111</guid>
      <dc:creator>mac_hallberg</dc:creator>
      <dc:date>2019-03-07T09:33:42Z</dc:date>
    </item>
  </channel>
</rss>

