View Single Post
Old 01-26-2023, 04:53 AM   #14
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,501
Karma: 8065348
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:	75
Size:	34.9 KB
ID:	199248  
chaley is offline   Reply With Quote