Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

BELOW is not a valid function

Hi, I need helping getting the Below function to work. Here is what I have and the issue:

LOAD ID,

     Size,

     Weight,

     if(ID = Below(ID), 0, Weight) as [Corrected Weight];

The intention is to compare the current ID with the line below and if the IDs match, then ignore the weight of all but the last weights (all of the ignored weights are the same value). I've read and tried to apply what's written in Below - chart function ‒ Qlik Sense, but always get the error in the title.

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: BELOW is not a valid function

In the script, there is no Below() function. You can't get QlikSense to look ahead in your table input records.

You would need to create a table load that is sorted the other way round using ORDER BY, then use PEEK() or PREVIOUS() to compare ID with the line just read before.

LOAD ID,

     Size,

     Weight,

     if(ID = Previous(ID), 0, Weight) as [Corrected Weight]

RESIDENT YourTable

ORDER BY Timestamp DESC; // adapt to a field you can use to order your table in reverse original order.

3 Replies
MVP
MVP

Re: BELOW is not a valid function

In the script, there is no Below() function. You can't get QlikSense to look ahead in your table input records.

You would need to create a table load that is sorted the other way round using ORDER BY, then use PEEK() or PREVIOUS() to compare ID with the line just read before.

LOAD ID,

     Size,

     Weight,

     if(ID = Previous(ID), 0, Weight) as [Corrected Weight]

RESIDENT YourTable

ORDER BY Timestamp DESC; // adapt to a field you can use to order your table in reverse original order.

undergrinder
Valued Contributor II

Re: BELOW is not a valid function

Hi Vincent,

swuehl‌ is right, Below and Above works only in charts, and with other UI objects.

G.

Not applicable

Re: BELOW is not a valid function

Thanks so much, that fixed it

Community Browser