KoolReport's Forum

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

Average Values in PivotMatrix #2070

Closed Christian Voß opened this topic on on May 11, 2021 - 2 comments

Christian Voß commented on May 11, 2021

Hi,

I have another issue with the PivotMatrix and PivotTable. For the values I want to have the average value of a column. All values are between 0 and 1 and are defined as float in the SQLServer. However the table rounds the results to either 1 or 0.

Ideally I'd like to see the average value as a percentage (i.e. values are: 0.8, 0.9) I'd like to see it as 85%. Currently it shows as 1. Is there a way to format this correctly? I haven't found it yet in the documentation.

Thanks and best regards

Christian

Sebastian Morales commented on May 12, 2021

Before piping the data to the Pivot process pls set the value column's meta to:

    ->pipe(new ColumnMeta(array(
        "valueColumn" => array(
            "type" => "number",
            "decimals" => 2,
        )
    )))

Tks,

Christian Voß commented on May 12, 2021

Great, thank you!

Best regards

Christian

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
help needed

None