Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 12-06-2019, 01:31 AM   #1
tamarissa
Connoisseur
tamarissa began at the beginning.
 
Posts: 55
Karma: 10
Join Date: Aug 2018
Device: Kobo Aura H2O
Column Built From Other Column Formula Adjustment

I have this formula that I use to put a collection into my eReader from a column, and it works just fine. I get an end result of "R - Tag" or "N - Tag", which is what I want. However, if none of the conditions are met, I just get an R or N (which is also technically correct, but I'd prefer if it just stayed blank if that's the case). Is there a way to make it so that the field remains blank if there are no matching tag criteria?

Code:
{#read_status:}{:'list_item(list_intersection(field("tag"),sublist("Tag  1,Tag 2,Tag 3,",0,0,","), ","),0,",")'| - |}
tamarissa is offline   Reply With Quote
Old 12-06-2019, 05:15 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: 11,738
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
This should do it assuming I understand your requirements, specifically that the R or N appears only when there is a matching tag.
Code:
program:
	x=list_item(
		list_intersection(
			field("tag"),
			"Tag 1,Tag 2, Tag 3",
			","),
		0,",");
	test(x, strcat(field('#mybool'), ' - ', x), '')
Note that you don't need to explicitly create a list (your use of sublist). A string of SEPARATOR-separated values works.
chaley is offline   Reply With Quote
Old 12-07-2019, 01:18 AM   #3
tamarissa
Connoisseur
tamarissa began at the beginning.
 
Posts: 55
Karma: 10
Join Date: Aug 2018
Device: Kobo Aura H2O
Yes, it sounds like you are understanding what I'm after, but I just tried your suggestion, and unfortunately, it didn't work for me... This is what the template tester said was wrong:

Quote:
EXCEPTION: Value: unknown field #mybool
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2019-12-06 at 11.13.55 PM.png
Views:	80
Size:	54.2 KB
ID:	175406  
tamarissa is offline   Reply With Quote
Old 12-07-2019, 04:21 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,791
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
those were placeholder names for custom field TYPES

change the #mybool to the name of your Boolean field's (Y/N) name
theducks is offline   Reply With Quote
Old 12-07-2019, 04:27 AM   #5
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: 11,738
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post
those were placeholder names for custom field TYPES

change the #mybool to the name of your Boolean field's (Y/N) name
This is correct. I didn't have a column #read_status so I used #mybool instead to test it.
chaley is offline   Reply With Quote
Old 12-07-2019, 01:19 PM   #6
tamarissa
Connoisseur
tamarissa began at the beginning.
 
Posts: 55
Karma: 10
Join Date: Aug 2018
Device: Kobo Aura H2O
Ah, I see... worked perfectly once I changed it to my '#read_status'. Thanks so much for your help!
tamarissa is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom column built from word count column Montana Harper Library Management 3 10-04-2018 09:57 PM
Column built from other column : Mark read if evaluated Cmely Library Management 1 02-26-2017 09:07 AM
Yes/No column built from other columns barlowrm Calibre 5 11-17-2016 02:34 PM
Tags Column - Left Alignment not maintaining adjustment crissman Calibre 7 02-20-2015 10:49 PM
Custom yes/no column built from long text column Philantrop Library Management 7 03-23-2013 07:44 PM


All times are GMT -4. The time now is 02:45 AM.


MobileRead.com is a privately owned, operated and funded community.