KoolReport's Forum

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

How to compare sales for the same quarter for two different years for a given entity #2460

Open Augustine Arthur opened this topic on on Nov 25 - 2 comments

Augustine Arthur commented on Nov 25

Please any suggestion on how to generate a report that compares the same quarters of two different years for the same parameters or indicators as shown in the image.

Sebastian Morales commented on Nov 26

Pls use the quarter function in your sql query and then the Cube process in your report:

//MyReport.php
$this->src("mysql")
->query("select quarter(activity_date) as 'activity_quarter', activity, ...") // other databases might have different quarter function from MySQL.
->pipe(new koolreport\cube\processes\Cube(array(
    "row" => "activity", 
    "column" => "activity_quarter",
    "count" => "actitivy",
)))
...

Let us know if we understand your question correctly. Tks,

Augustine Arthur commented on Nov 26

Thank you for the response. I will try it. I will get back to you for any further assistant if the need arises. I think I will also want to create multiple selection for years so that I will select which years I want to compare their quarters.

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
None yet

None