Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-15-2012, 07:07 PM   #1
Ealdwulf
Member
Ealdwulf began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jun 2012
Device: Nook
[Custom Column - Composite] Template Help Requested

I am hoping that someone can help me figure this out. Based upon the information that I am reading in the manual and documentation it should be doable, but I may be missing something.

I have three Custom Columns that are the following:
  • chapters - Integer
  • last_chapter_read - Integer
  • chapters_remaining - Composite

What I am trying to do is have the chapters_remaining column calculate the difference between chapters and last_chapter_read. There is a math function called subtract (x, y) that by all appearances should do the job that I want to do. Unfortunately all attempts I have made at getting this to work have failed with differing errors depending upon what I have entered for the template.

Can someone help me figure this out?
Ealdwulf is offline   Reply With Quote
Old 06-16-2012, 04:51 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,703
Karma: 6658935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Try something like
Code:
program: format_number(subtract(field('#chapters'), field('#last_chapter')), '{0:.0f}')
Clearly you must use the right lookup keys for your columns.

Last edited by chaley; 06-16-2012 at 05:00 AM. Reason: Fix syntax error introduced by copy/paste
chaley is offline   Reply With Quote
Advert
Old 06-16-2012, 04:58 AM   #3
Ealdwulf
Member
Ealdwulf began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jun 2012
Device: Nook
It had an extra ') at the end but once I removed that it worked perfectly. THANK YOU!
Ealdwulf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugboard, template, and custom composite column recipes chaley Library Management 971 12-04-2023 04:57 PM
Sorting/searching composite column causes slow startup [solved] capnm Library Management 0 11-08-2011 11:44 AM
Composite column or not ? Bertrand Library Management 3 08-24-2011 01:27 AM
Help with template for custom column from tags africalass Library Management 2 07-16-2011 11:47 AM
Custom Composite Column silentguy Calibre 4 11-24-2010 10:28 AM


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


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