KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Table widget - grouping - no possibility to count avg #1229

Closed peter sereny opened this topic on on Dec 27, 2019 - 3 comments

peter sereny commented on Dec 27, 2019

Hello,

I was trying to get an average to be calculated for a column in the table widget using grouping function. Adding

    "grouping"=>array(
        "agent"=>array(
            "calculate"=>array(
                "{commPaidSum}"=>array("sum","commPaid"),
            	"{CommissAvg}"=>array("avg","AgentCommPerc"),
            	"{revenueSum}"=>array("sum","revenue"),
            ),

did not give me the result expected. After looking for the problem root, I discovered a bug in your code at core/src/widgets/koolphp/Table.php at line 238 it is

                        if (in_array($method, array("sum", "count", "min", "max", "mode"))) {

and should be including the "avg":

                        if (in_array($method, array("sum", "count", "min", "max", "mode", "avg"))) {

Please correct it. Kind Regards!

KoolReport commented on Dec 27, 2019

Thank you very much, I will update with dev. team.

KoolReport commented on Dec 27, 2019

Updated from dev.team: The issue has been fixed before, and it will be in next release. Thank you again.

peter sereny commented on Dec 27, 2019

:-)

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
bug
solved

None