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 03-31-2025, 09:49 AM   #1
fellars
Junior Member
fellars began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2023
Device: iPad
Smile Custom Column "Series Count"

I am trying to create a custom column that shows the total number of books in a series. i.e.. if I have 4 separate books in the series "Above the Sky", I'd like to have a column that shows the number 4 in each book under the series "Above the Sky." Is this possible, and if so, could you please let me know how to do this? Thanks!
fellars is offline   Reply With Quote
Old 03-31-2025, 10:00 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: 12,436
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
  • Set the tweak (Preferences / Tweaks) "Allow template database functions in composite columns (ID: allow_template_database_functions_in_composites)" to True, as in
    Code:
    allow_template_database_functions_in_composites = True
  • Create a "Column built from other columns" that uses the template
    Code:
    program:
    	if $series then
    		book_count('series:"=' & $series & '"', 0)
    	else
    		''
    	fi
    Set Sort/search for the column to "Number"
chaley is offline   Reply With Quote
Advert
Old 03-31-2025, 11:07 AM   #3
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: 31,037
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by fellars View Post
I am trying to create a custom column that shows the total number of books in a series. i.e.. if I have 4 separate books in the series "Above the Sky", I'd like to have a column that shows the number 4 in each book under the series "Above the Sky." Is this possible, and if so, could you please let me know how to do this? Thanks!
Not to rain on the parade. Counts like these are already available in the Tag Browser without adding to DB bloat. (this is why I use empty books as my wish list and I have a Wishlist VL that shows just those without a format )

2 flaws with either : They only show the count for ENTRIES in the Library, not the actual series available.

Note: The Tag Browser respects the current Virtual Library count. (I have no idea what chaleys count does in this condition)
theducks is online now   Reply With Quote
Old 03-31-2025, 11:31 AM   #4
MSWallack
Right, Except When Wrong
MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.MSWallack ought to be getting tired of karma fortunes by now.
 
MSWallack's Avatar
 
Posts: 363
Karma: 4323767
Join Date: Aug 2007
Location: Indianapolis
Device: Kindle Oasis 3 (sometimes iPad Mini).
How would this work with series that have books that fall between the main books and thus have been numbered x.5 or prequels that are numbered 0.0?
MSWallack is offline   Reply With Quote
Old 03-31-2025, 11:33 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: 12,436
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post
Not to rain on the parade. Counts like these are already available in the Tag Browser without adding to DB bloat. (this is why I use empty books as my wish list and I have a Wishlist VL that shows just those without a format )
Composite columns don't add "bloat". All that is in the db is the column definition, around 50 bytes + the length of the template.
Quote:

2 flaws with either : They only show the count for ENTRIES in the Library, not the actual series available.

Note: The Tag Browser respects the current Virtual Library count. (I have no idea what chaleys count does in this condition)
As written the template ignores VLs. If you want the count to respect VLs then in the call to book_count change the zero to a 1.
chaley is offline   Reply With Quote
Advert
Old 03-31-2025, 11:36 AM   #6
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,436
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by MSWallack View Post
How would this work with series that have books that fall between the main books and thus have been numbered x.5 or prequels that are numbered 0.0?
Both the template and the tag browser count books with the same series name. The series_index is ignored.
chaley is offline   Reply With Quote
Old 03-31-2025, 12:15 PM   #7
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: 31,037
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by chaley View Post
Composite columns don't add "bloat". All that is in the db is the column definition, around 50 bytes + the length of the template.

As written the template ignores VLs. If you want the count to respect VLs then in the call to book_count change the zero to a 1.
I shoulda known you would think of everything,
theducks is online now   Reply With Quote
Reply

Tags
custom column, series


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading time by creating a column with "word count"/"your wpm" Anyssia Calibre 2 01-04-2019 01:02 PM
Custom column for "Volume" and "Version" (Revision) BaronKrause Library Management 10 11-02-2017 09:20 PM
Custom column: "pubdate" and "ifempty" StillReading Library Management 3 04-07-2015 01:04 AM
Using "Build column from other column" custom-column type HFC3 Library Management 3 07-07-2013 03:11 AM
Custom column: "Updated date", when adding new "versions" of the same file? enriquep Library Management 16 11-03-2011 10:46 AM


All times are GMT -4. The time now is 05:35 PM.


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