KoolReport's Forum

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

How to use transpose process on dashboard? #2834

Open GHSix opened this topic on on Sep 23, 2022 - 4 comments

GHSix commented on Sep 23, 2022

I'm trying to use FunnelChart.

protected function dataSource()
    {
        return $this->dashboard()->getDataG1()
            ->run()
            ->process(\koolreport\processes\Group::process([
                'sum' => ['qty_doc','qty_valid'],
                'count' => ['accepted']
            ]))
            ->process(\koolreport\processes\Transpose::process());
            
    }

With just the Group proccess, my result is a 1 row with values like (300, 200 and 100). But the Transpose seems to want a parameter that I can't figure out what is. And, after pipe it through Transpose I guess I will need to pipe it through ColumnRename as well.

Sebastian Morales commented on Sep 26, 2022

Pls try this instead:

        return $this->dashboard()->getDataG1()
            ->run()
            ->process(
                \koolreport\processes\Group::process([
                    'sum' => ['qty_doc','qty_valid'],
                    'count' => ['accepted']
                ])
                    ->pipe(new \koolreport\processes\Transpose())                
            ); 
GHSix commented on Sep 26, 2022

Adding ->pipe, it will not return any errors but the result is a lot of rows with value 0 (zero) on all Number columns and empty for all Text columns.

Sebastian Morales commented on Sep 28, 2022

What is the result if you remove the Transpose process?

GHSix commented on Sep 28, 2022

With just the Group proccess, my result is a 1 row with 3 columns and values like (300, 200 and 100).

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

Dashboard