跳至内容
菜单
此问题已终结
1 回复
2147 查看

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.

形象
丢弃
最佳答案

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")

形象
丢弃