Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Substract 2 different rows of a single table

Hi All,

I am developing an application in qlikview where I need a formula to substract 2 different rows of a single table

Here is the sample of the table I am having.

Date: Different dates of a perticular month (here:D1,D2,D3..etc)

Field 1: Field2's Value depends on this column

Field 2: Its a calculated field, derived from the values of Field 1.

Untitled.png

The logic for Field 2 is first row will be 0 as it dont have no previous value. The 2nd row will be Value of 2nd Row of Field 1- Value of 1st row of Field 1

i.e: Current row value-previous row value.

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.

Kindly help.

11 Replies
Anonymous
Not applicable
Author

How to do the same in a KPI ? I want to calculate sum of those differences in a KPI ....

mac_hallberg
Contributor
Contributor

Thanks a lot, worked perfect!

 

//Marcus