Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

When I use the Above() function, doesn't permit to order values. Why?

Hi all,

Question:

When I use the Above() function, doesn't permit to order values in Straight table. Why?

Any comment?

Thanks and Regards.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It's a program design problem. Above() refers to the row physically one row up. But what happens if the sort order changes  the row that is above? We recalculate the column that uses above() value. What if that column is the sort column? We  sort and then recalculate and so on and we have the possibility of an endless loop. So the only safe bet is to disallow sorting on the expression column that may rely on any inter-row chart function like above() or rowno().

-Rob

Http://robwunderlich.com

View solution in original post

5 Replies
Not applicable
Author

Any ideas?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It's a program design problem. Above() refers to the row physically one row up. But what happens if the sort order changes  the row that is above? We recalculate the column that uses above() value. What if that column is the sort column? We  sort and then recalculate and so on and we have the possibility of an endless loop. So the only safe bet is to disallow sorting on the expression column that may rely on any inter-row chart function like above() or rowno().

-Rob

Http://robwunderlich.com

Not applicable
Author

I suspected.

Thanks Rob.

wizardo
Creator III
Creator III

Hi rob,

I agree that when we should not be able to sort on the row that contains the "inter record function" but I don't understand why it should be a problem to sort on other columns.

that does not create a loop or deadlock of any kind. the column containing the "above function" can be then recalculated based on the numbers in the new sorted rows.

and i guess that's what Ricardo wanted to happen.

i wish there was a way to tell qlikview to transform the numbers in the cells of a column to "Values" in a similar way it is done in excel. then the user could turn the column that contains the "Above" function" to values and use that as the sort column.

btw

this restriction of not been able to sort when using a "inter Range function" is not documented (as far as i could find)

only related topic is  a NOTE in the inside help that states

"Sorting on y-values in charts or sorting by expression columns in straight tables is not allowed when Chart Inter Record functions are used in any of the chart's expressions. These sort alternatives are therefore automatically disabled."

another btw.

if its such a problem to use sort in these circumstances, why is it allowed in pivot table?

Mansyno

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You would have to take it up with QT to see if some type of limited sorting could be allowed. I have a time hard time getting my head around all the possibilities and potential problems. As it now stands, dynamic sorting of Y values is disabled even if the inter-record function does not contribute to a cell value. For example, using an inter-record function in a background expression will disable dynamic column sorting,

That quote from Help you posted above is the documentation I know of. I agree it could be improved to specify dynamic sorting.

The reason the restriction does not apply to Pivot Tables is because PT does not allow for dynamic (user quick sort) sorting.

-Rob