Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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.

View solution in original post

3 Replies
swuehl
MVP
MVP

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

Hi Vincent,

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

G.

Not applicable
Author

Thanks so much, that fixed it