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 04-05-2018, 02:39 AM   #16
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
Thanks so much.

I was wondering if these could be combined. I would like to keep the composed icon as I have another rule with icon in the same column. As it is now both icons show up, I was wondering if combining it would be the trick to only showing one of them at a time.

Code:
program:
   cmp(count(field('#fandoms'),'&'), 2,'','', 'multi.png')
combined with:

Code:
program:
cmp(count(field('#fandoms'),'&'), 1,'','', 'crossover.png')
Tanjamuse is offline   Reply With Quote
Old 04-05-2018, 03:33 AM   #17
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
The problem you are having is that the definition of the cmp function is:

Code:
cmp(x, y, lt, eq, gt)
The values in the "lt", "eq" and "gt" parameters are return depending on the result of the comparison between "x" and "y". If "x < y", then whatever is in the "lt" position is returned, if "x = y", then "eq" is returned and if "x > y", then "gt" is return. In both of your templates, you are returning a value for the "x > y" case.

That means that the second template returns the icon name if there is two or more fandoms.

And the first template returns the icon name if there are three or more fandoms.

But, if there are three or more fandoms, then the condition in the second template is also met, so it returns the icon as well.

With this, the second template should be:

Code:
program:
cmp(count(field('#fandoms'), '&'), 2, '', 'crossover.png', '')
That will return "crossover.png" if there are exactly 2 fandoms.

But, combining them is probably better:

Code:
program:
cmp(count(field('#fandoms'), '&'), 2, '', 'crossover.png', 'multi.png')
That returns nothing if there is one fandom, "crossover.png" if there are two fandoms and "multi.png" if there are three or more fandoms.


Disclaimer: I haven't tested these templates. They have been written by looking at the manual.
davidfor is offline   Reply With Quote
Advert
Old 04-05-2018, 04:37 AM   #18
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,616
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by davidfor View Post
Disclaimer: I haven't tested these templates. They have been written by looking at the manual.
At least you write the disclaimer, mine were written in the same way
Terisa de morgan is offline   Reply With Quote
Old 04-05-2018, 05:23 AM   #19
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
Thanks.

I was wondering, can I combine ratings like those in the attached images in an advanced rule as well?

It's a comma separated text, like tags, shown in the tag browser column.

Thanks again for the help.
Attached Thumbnails
Click image for larger version

Name:	Skærmbillede 2018-04-05 11.21.44.png
Views:	159
Size:	41.0 KB
ID:	163247   Click image for larger version

Name:	Skærmbillede 2018-04-05 11.21.56.png
Views:	166
Size:	41.6 KB
ID:	163248  

Last edited by Tanjamuse; 04-05-2018 at 05:25 AM.
Tanjamuse is offline   Reply With Quote
Old 04-30-2018, 11:45 AM   #20
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
I've tested this quite a bit, but no luck.

Code:
program:
cmp(count(field('#fandoms'), '&'), 2, '', 'crossover.png', 'multi.png')
It's supposed to be a combination of these two:

Code:
program:
   cmp(count(field('#fandoms'),'&'), 2,'','', 'multi.png')
and

Code:
program:
cmp(count(field('#fandoms'),'&'), 1,'','', 'crossover.png')
Tanjamuse is offline   Reply With Quote
Advert
Old 04-30-2018, 10:40 PM   #21
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
That looks like it should work. At least if I understand what you are trying to do. But, how is this configured elsewhere, and what actually happens?
davidfor is offline   Reply With Quote
Old 05-01-2018, 01:26 AM   #22
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
It was a simple oversight on my part ... I had forgotten that I renamed the icons
Tanjamuse is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Icon Rule Tanjamuse Library Management 17 10-13-2016 03:30 PM
Advanced Custom Icon with two requirements One4Tanner Library Management 3 03-11-2015 02:14 AM
The 5 finger rule. AlexGrama General Discussions 73 02-26-2012 05:19 AM
ID: Rule Above and Below dezignlady ePub 5 07-12-2011 11:40 PM
Will One Device Rule Them All... Or Not thymaster General Discussions 65 11-23-2010 01:19 PM


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


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