Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Paulo_IntelFab
Contributor III
Contributor III

Get a column with the difference between two rows - Above() not working

Hi, I need to get a column with the diffence between a row and the previous row. I`m using Qlik Cloud and the load script is quite simple. 

[Teste_NPTs]:
LOAD
[OrderingField],
[SubtractField],
[Flag]
FROM [lib://A - Rascunho:DataFiles/Teste_NPTs.qvd]
(qvd);

The rows look like this: 

Paulo_IntelFab_0-1718214644363.png

I tried to use the function Above, but an error is thrown and I cannot solve it. 

[Teste_NPTs]:
LOAD
[CampoOrdenar],
[CampoSubtrair],
[Flag],
[CampoSubtrair] - Above([CampoSubtrair]) As difference

FROM [lib://A - Rascunho:DataFiles/Teste_NPTs.qvd]
(qvd);

The error message is: 
Unexpected token: '(', expected one of: ',', ':', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', ...

[Teste_NPTs]: LOAD [CampoOrdenar], [CampoSubtrair], [Flag], [CampoSubtrair] - Above>>>>>>(<<<<<<[CampoSubtrair]) As difference FROM [lib://A - Rascunho:DataFiles/Teste_NPTs.qvd] (qvd)

I'm glad for any help! 

Labels (1)
1 Solution

Accepted Solutions
marksouzacosta

Hi @Paulo_IntelFab 

Above is a chart function, it does not work in the Load Script.
Look for Previous (Previous - script function | Qlik Sense on Windows Help) or Peek (Peek - script function | Qlik Sense on Windows Helpfunctions.

Read more at Data Voyagers - datavoyagers.net

View solution in original post

2 Replies
marksouzacosta

Hi @Paulo_IntelFab 

Above is a chart function, it does not work in the Load Script.
Look for Previous (Previous - script function | Qlik Sense on Windows Help) or Peek (Peek - script function | Qlik Sense on Windows Helpfunctions.

Read more at Data Voyagers - datavoyagers.net
Paulo_IntelFab
Contributor III
Contributor III
Author

Thanks a lot!