ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: vivianteoh on January 08, 2020, 01:22:52 pm

Title: Sum percentage
Post by: vivianteoh on January 08, 2020, 01:22:52 pm
May I know is there a way to sum percentage correctly?
See sample below:
(https://imgur.com/fWpAwJR.png)
I have a formula (column B / column A) * 100%. If the result column is summed, the result is shown as 113.06 but what I want is (total of column B / total of column A) * 100% = 0.77.
May I know is there a way to do so?
Title: Re: Sum percentage
Post by: paramvir on January 08, 2020, 11:02:27 pm
It can be done by writing a column.render callback for affected column and override the cell value in summary row.

Code: [Select]
column.render = function(ui){
 var rd = ui.rowData;
 if(summary row ){
   return rd.B/rd.A * 100
 }
}
Title: Re: Sum percentage
Post by: vivianteoh on January 10, 2020, 09:09:46 am
Thanks. Will try this out.