Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Paulo_IntelFab
Contributor
Contributor

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
Partner - Specialist
Partner - Specialist

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
Partner - Specialist
Partner - Specialist

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
Contributor
Author

Thanks a lot!