Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2116 Widoki

Hey i have 3 columns obtain mark , total mark and percentage. I am getting all the data from sql query and its working fine. But when we group by it adds everything and my percentage exceeds 100%. I have tried using average but its not accurate enough. Is there a way of finding percentage after using group by?

Thanks in advance, kindly help.

Awatar
Odrzuć
Najlepsza odpowiedź

Hello,

all you need to do is add group_operator="avg" in you custom field :

example:

custom_field = fields.Float(
string='Rate %', group_operator="avg")

Awatar
Odrzuć