Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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 (2)
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
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

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
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

Paulo_IntelFab
Contributor III
Contributor III
Author

Thanks a lot!