View Single Post
Old 01-27-2022, 04:32 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
I wanted to fix some stubborn multi-column sorting (e.g. currently-reading books getting separated depending on whether or not they were on the TBR list) and the best way I figured to do it was to combine #currentlyreading and #onreadinglist:

Code:
program:
	if $$#percentread >=# 1 && $$#percentread <=# 99
	then 'Currently Reading'

	elif $#readinglist == 'To Be Read' && $$#percentread ==# 0
	then 'To Be Read'

	else 'zzz'

	fi
But is there a more elegant way to make undefined values sort to the bottom when using A-Z sort?
Composite columns cannot be undefined. They always contain at least the empty string.

In your case I would choose different strings for 'Currently Reading' and 'To Be Read' that sort 'correctly' in a descending sort. For example, 'Currently Reading' ==> 'Now Reading' and 'To Be Read' ==> 'Future'.
chaley is offline   Reply With Quote