![]() |
#1 |
null operator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,060
Karma: 22381319
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 |
![]() |
![]() |
![]() |
#2 |
Grumpy old git
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,983
Karma: 5053935
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 Last edited by chaley; 01-25-2023 at 08:54 AM. Reason: Edit: added support for ratings columns |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,091
Karma: 41731015
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.
![]() |
![]() |
![]() |
![]() |
#4 | |
Grumpy old git
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,983
Karma: 5053935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
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 08:55 AM. |
|
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,091
Karma: 41731015
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84
Karma: 721206
Join Date: Dec 2022
Location: Not in an English speaking country
Device: Kobo Libra H2O
|
|
![]() |
![]() |
![]() |
#7 | |
null operator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,060
Karma: 22381319
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
![]() |
![]() |
![]() |
#8 | |
Grumpy old git
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,983
Karma: 5053935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#9 |
null operator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,060
Karma: 22381319
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 |
![]() |
![]() |
![]() |
#10 |
Grumpy old git
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,983
Karma: 5053935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#11 | |
null operator
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,060
Karma: 22381319
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
"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 05:42 PM. |
|
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,091
Karma: 41731015
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:
You need to pre-select the columns in the config. Last edited by ownedbycats; 01-25-2023 at 05:50 PM. |
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,091
Karma: 41731015
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 Code:
if fm['datatype'] not in ('int', 'float', 'rating'): Last edited by ownedbycats; 01-25-2023 at 05:53 PM. |
![]() |
![]() |
![]() |
#14 | |
Grumpy old git
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,983
Karma: 5053935
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#15 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,091
Karma: 41731015
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.
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Column: Average Rating by Author | Lys | Library Management | 5 | 12-09-2022 04:31 AM |
[GUI Plugin] Sum Column | a.peter | Plugins | 31 | 04-04-2022 10:51 PM |
Can I generate sum of column or columns? | GeekyGal | Calibre | 5 | 09-29-2011 07:32 PM |
Question/suggestion on putting an Omnibus into the Series column | slayda | Calibre | 16 | 08-23-2011 08:34 PM |
Add more column options to book list | rgoulde | Calibre | 2 | 10-06-2009 08:03 AM |