Hi!
In my Book Tracker I have a property “series” and another one as “volume”.
In the author’s note I’ve created some queries to show the books written from the author, with some block referring only to the series.
I wish the books ordered by volume but I can’t get this since 10 is put before 2 (by example)
I can’t change the property to “number” since some books are “volume 1 2” or “single volume” (with all the books referring to the series).
It would be possible to sort by volume number or I have to choose a different field for sorting? (i.e. publish date)
You’re still not giving a full example of the variants in your case, like which variants of the “volume 1 2” or “volume first” do you have…
In the simple case, you could try using SORT number(volume) to try extracting the number from the text. See number().
That function will return null if there are no numbers in the text, and I’ve not test extensively how it’ll behave with multiple numbers. If you’re likely to have text only volumes, and you’ll like these to be sorted, maybe the following will work better for you: default( number(volume), volume) . That expression will pull a number out of the text, if present, or else it’ll use the text variant as is.
Thanks a lot. Your simple solution (maybe simple for you, not for me ) is the right one.
Anyway I’ll check also the link you’ve provided: I’ll learn something new and this is a good thing to do.