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 01-24-2023, 10:23 PM   #1
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 18,816
Karma: 21287025
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Suggestion: Sum and Average in Column header options

Add an option to the Column Header context menu (press 'H' on a cell) for integers and floats that calculates the Sum and Average of the column for the selected books and shows the results in a copy-able popup.

BR
BetterRed is offline   Reply With Quote
Old 01-25-2023, 07:09 AM   #2
chaley
Grumpy old git
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.
 
chaley's Avatar
 
Posts: 10,901
Karma: 4839799
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Here is an action chain that computes what you want. Install it and give it a keyboard shortcut.

To use it, select a cell then extend the selection over the books you want.

Edit: added support for ratings columns
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	41
Size:	29.1 KB
ID:	199237  
Attached Files
File Type: zip sum_selected_column_action.zip (863 Bytes, 14 views)

Last edited by chaley; 01-25-2023 at 09:54 AM. Reason: Edit: added support for ratings columns
chaley is offline   Reply With Quote
Advert
Old 01-25-2023, 07:42 AM   #3
ownedbycats
Grand Sorcerer
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 5,603
Karma: 30000000
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
There's also a Sum Column plugin that works on both ints and floats for selected books.
ownedbycats is offline   Reply With Quote
Old 01-25-2023, 07:54 AM   #4
chaley
Grumpy old git
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.
 
chaley's Avatar
 
Posts: 10,901
Karma: 4839799
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
There's also a Sum Column plugin that works on both ints and floats for selected books.
Too bad it isn't in the plugin index. I actually looked to see if something already did the job. Perhaps because the plugin is no longer supported.

One difference: this action chain version doesn't require you to predefine the column to be summed. It works on the selected column. However, it doesn't work on ratings, but that isn't a hard change to make.

Edit: the action chain in the second post now supports ratings columns

Last edited by chaley; 01-25-2023 at 09:55 AM.
chaley is offline   Reply With Quote
Old 01-25-2023, 09:15 AM   #5
ownedbycats
Grand Sorcerer
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 5,603
Karma: 30000000
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I think the developer abandoned it, though there's a fixed version for Py3 on the last page.
ownedbycats is offline   Reply With Quote
Advert
Old 01-25-2023, 09:26 AM   #6
Lys
Enthusiast
Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.Lys ought to be getting tired of karma fortunes by now.
 
Posts: 44
Karma: 335764
Join Date: Dec 2022
Location: Not in an English speaking country
Device: Kobo Libra H2O
Quote:
Originally Posted by chaley View Post
Here is an action chain that computes what you want. Install it and give it a keyboard shortcut.

To use it, select a cell then extend the selection over the books you want.
Thanks, chaley
Lys is offline   Reply With Quote
Old 01-25-2023, 04:52 PM   #7
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 18,816
Karma: 21287025
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
Here is an action chain that computes what you want. Install it and give it a keyboard shortcut.

To use it, select a cell then extend the selection over the books you want.
I tried that a few months ago, but I don't think it I twigged that it's select cell and then select books - I think I assumed it iterated over all the books shown in the list - I'll reinstall AC and give it another go.

BR
BetterRed is offline   Reply With Quote
Old 01-25-2023, 05:00 PM   #8
chaley
Grumpy old git
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.
 
chaley's Avatar
 
Posts: 10,901
Karma: 4839799
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
I tried that a few months ago, but I don't think it I twigged that it's select cell and then select books - I think I assumed it iterated over all the books shown in the list - I'll reinstall AC and give it another go.

BR
It probably didn't work. This chain uses a bespoke python template that "talks" directly to the calibre GUI to get the selected column then the selected books. I don't know how to do the same thing with standard action chain selection modifiers.

Bottom line: action chains can be used to run more-or-less arbitrary GUI processes using python templates. For me, this is preferable to building things into the GUI, because I avoid all sorts of maintenance and compatibility headaches. On the other hand, we might want to keep an index of this sort of thing, perhaps including template searches, so they are discoverable. At the moment, how to do that efficiently is a mystery.
chaley is offline   Reply With Quote
Old 01-25-2023, 06:09 PM   #9
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 18,816
Karma: 21287025
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I don't know where I found your chain originally, must have been in a drive-by thread

I wouldn't use the sum_selected… chain often enough to warrant a shortcut, and given I don't have any other use for the AC plugin I think I'll stick to pumping a catalogue into Excel. Which has the advantage that I can save an xlsx in the source physical/virtual library.

BR
BetterRed is offline   Reply With Quote
Old 01-25-2023, 06:12 PM   #10
chaley
Grumpy old git
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.
 
chaley's Avatar
 
Posts: 10,901
Karma: 4839799
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
I don't know where I found your chain originally, must have been in a drive-by thread
You couldn't have found it before. I wrote it today.

Using excel is a fine alternative.
chaley is offline   Reply With Quote
Old 01-25-2023, 06:38 PM   #11
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 18,816
Karma: 21287025
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
You couldn't have found it before. I wrote it today.

Using excel is a fine alternative.
Perhaps it was the plugin owb mentioned, whatever it was, it didn't work for me, so I let it go through to the 'keeper. My suggestion yesterday was prompted by the wish to beat several people around the head with:

"Stop whinging about there being no 'Detail' and do what I did, read the 700,000+ words in these 1,000+ pages ==>> a.pdf, b.pdf, c.pdf…"

The .pdfs include Joint Select Committee and Hansard reports

Last edited by BetterRed; 01-25-2023 at 06:42 PM.
BetterRed is offline   Reply With Quote
Old 01-25-2023, 06:43 PM   #12
ownedbycats
Grand Sorcerer
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 5,603
Karma: 30000000
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Sum Column silently fails if there's zero books selected. Otherwise you get a dialog:

Click image for larger version

Name:	2023-01-25 18_43_05-Sum Column.png
Views:	17
Size:	7.4 KB
ID:	199247

You need to pre-select the columns in the config.

Last edited by ownedbycats; 01-25-2023 at 06:50 PM.
ownedbycats is offline   Reply With Quote
Old 01-25-2023, 06:47 PM   #13
ownedbycats
Grand Sorcerer
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 5,603
Karma: 30000000
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
On the topic, I was mildly interested to see that the action chain works on a custom ratings column (though sum and median aren't very useful in this case):

Code:
Column name: Ratings (#ratings)
Column type: rating
Count of selected books: 635
Count of books with a non-empty value: 635
Sum: 2110.500
Average: 3.324
Median: 3.500
EDIT: Line 9 specifically accounts for this:

Code:
	if fm['datatype'] not in ('int', 'float', 'rating'):

Last edited by ownedbycats; 01-25-2023 at 06:53 PM.
ownedbycats is offline   Reply With Quote
Old 01-26-2023, 05:53 AM   #14
chaley
Grumpy old git
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.
 
chaley's Avatar
 
Posts: 10,901
Karma: 4839799
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
On the topic, I was mildly interested to see that the action chain works on a custom ratings column (though sum and median aren't very useful in this case):

Code:
Column name: Ratings (#ratings)
Column type: rating
Count of selected books: 635
Count of books with a non-empty value: 635
Sum: 2110.500
Average: 3.324
Median: 3.500
EDIT: Line 9 specifically accounts for this:

Code:
	if fm['datatype'] not in ('int', 'float', 'rating'):
FWIW: it is more complicated than that because ratings are multiplied by 2, ranging from 0 to 10. Doing computations on them requires accounting for that, usually dividing by 2. You can see this in a GPM template using raw_field().
Attached Thumbnails
Click image for larger version

Name:	Clipboard03.jpg
Views:	16
Size:	34.9 KB
ID:	199248  
chaley is offline   Reply With Quote
Old 01-26-2023, 11:16 AM   #15
ownedbycats
Grand Sorcerer
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 5,603
Karma: 30000000
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
interesting, using field instead of raw_field (or $ instead of $$) fixes that.
ownedbycats 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
Custom Column: Average Rating by Author Lys Library Management 5 12-09-2022 05:31 AM
[GUI Plugin] Sum Column a.peter Plugins 31 04-04-2022 11:51 PM
Can I generate sum of column or columns? GeekyGal Calibre 5 09-29-2011 08:32 PM
Question/suggestion on putting an Omnibus into the Series column slayda Calibre 16 08-23-2011 09:34 PM
Add more column options to book list rgoulde Calibre 2 10-06-2009 09:03 AM


All times are GMT -4. The time now is 08:20 AM.


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