View Single Post
Old 04-30-2023, 10:24 AM   #947
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,358
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Amon_Re View Post
I'm trying to make a composite column to display the "Reading Status" based on the actual value of a column "%percent read".

I can use the following to set to 'Complete' if %percent read" is set to 100
Code:
{:'cmp(field('#kobo_percent_read'),100,'','Finished','Finished')'}
I want to change this to set to reading if the value is between 1 and 99 and unread if 0 or blank

Can this be done?
Assuming you are running calibre 6.12 or later:
Code:
{#kobo_percent_read:'switch_if($ >= 100, 'finished', $ <= 0, 'unread', 'reading')'}
chaley is offline   Reply With Quote