Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-16-2014, 12:06 PM   #1
demig
Junior Member
demig began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2013
Device: Kindle NT4
Using add(x,y) to add 2 columns

Hi,

Being driven mad here and I am sure the answer if on the forum or in the documentation but I'm going round in circles so be kind to me!

I have 2 custom columns both containing numbers and I want to display another column which adds them both up.

I have created a new column which is set to be a "column built from other columns" and into it I have tried entering many different versions of add(x,y) with varying errors!

At the moment I have tried:

{add (#a,#b)}

I believe this doesn't work as it needs a field as I get an unknown field error.
Entering the name of the custom column as follows:

{#sum: add (#a,#b)}

gives:

convert string to float: TEMPLATE ERROR could not convert string to float: #a,#b

Both input columns are integers.

I have tried lots of other variants and I am now just utterly confused!

Can someone tell me what I am doing wrong, I am sure this is a simple thing!

Thanks

Iain
demig is offline   Reply With Quote
Old 09-16-2014, 02:24 PM   #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: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
To use add in the way you indicate you must use general program mode.
Try something like
Code:
program: add(field('#a'), field('#b'))
chaley is offline   Reply With Quote
Advert
Old 09-16-2014, 03:00 PM   #3
demig
Junior Member
demig began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Nov 2013
Device: Kindle NT4
Brilliant that's worked perfectly

Many thanks

Iain
demig is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metadata(_('Unknown')) : How To Dynamically Add Custom Columns To Definition DaltonST Development 11 08-27-2014 01:29 AM
when does calibre add/not add page_styles css cybmole Calibre 5 07-14-2014 03:58 AM
3 suggestions: merge on add, cleanup on add, sorting changeling Calibre 5 08-24-2013 06:35 AM
Trying to add large library of books - add books seems to have hung nicknefarious Library Management 1 06-18-2012 09:32 AM
calibredb add -- how to add additional metadata? TuxGirl Calibre 16 12-29-2011 01:01 AM


All times are GMT -4. The time now is 07:10 AM.


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