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, 08:07 PM   #1
Ealdwulf
Junior Member
Ealdwulf began at the beginning.
 
Posts: 9
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, 05:51 AM   #2
chaley
"chaley", not "charley"
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: 5,898
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
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 06:00 AM. Reason: Fix syntax error introduced by copy/paste
chaley is offline   Reply With Quote
Old 06-16-2012, 05:58 AM   #3
Ealdwulf
Junior Member
Ealdwulf began at the beginning.
 
Posts: 9
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 626 12-13-2014 10:34 PM
Sorting/searching composite column causes slow startup [solved] capnm Library Management 0 11-08-2011 12:44 PM
Composite column or not ? Bertrand Library Management 3 08-24-2011 02:27 AM
Help with template for custom column from tags africalass Library Management 2 07-16-2011 12:47 PM
Custom Composite Column silentguy Calibre 4 11-24-2010 11:28 AM


All times are GMT -4. The time now is 06:34 AM.


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