octobercms/october · error · ApplicationException

Invalid aggregate function:

Error message

Invalid aggregate function: 

What it means

Error "Invalid aggregate function: " thrown in octobercms/october.

Source

Thrown at modules/dashboard/classes/ReportDateDataSet.php:311

            $aggregateFunction = $metricAggregateFunctions[$columnName];
            switch ($aggregateFunction) {
                case ReportMetric::AGGREGATE_COUNT:
                    if ($metricValue !== null) {
                        $aggregatedValue = $aggregatedValue === null ? 1 : $aggregatedValue + 1;
                    }
                    break;
                case ReportMetric::AGGREGATE_MAX:
                        $aggregatedValue = $aggregatedValue === null ? $metricValue : max($aggregatedValue, $metricValue);
                    break;
                case ReportMetric::AGGREGATE_MIN:
                        $aggregatedValue = $aggregatedValue === null ? $metricValue : min($aggregatedValue, $metricValue);
                    break;
                case ReportMetric::AGGREGATE_SUM:
                        $aggregatedValue = $aggregatedValue === null ? $metricValue : $aggregatedValue + $metricValue;
                    break;
                default:
                    throw new ApplicationException('Invalid aggregate function: '.$aggregateFunction);
            }

            $aggregationSet->$columnName = $aggregatedValue;
        }
    }

    private function isStartOfGroupInterval(Carbon $date): bool
    {
        if ($this->groupInterval === ReportDataSourceBase::GROUP_INTERVAL_WEEK) {
            return $date->dayOfWeek === Carbon::MONDAY;
        }

        if ($this->groupInterval === ReportDataSourceBase::GROUP_INTERVAL_MONTH) {
            return $date->day === 1;
        }

        if ($this->groupInterval === ReportDataSourceBase::GROUP_INTERVAL_QUARTER) {
            return $date->day == 1 && in_array($date->month, [1, 4, 7, 10]);

View on GitHub (pinned to b608633a7e)

When it happens

Trigger: Thrown at modules/dashboard/classes/ReportDateDataSet.php:311 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/2ca4b5670eb3d8dc. Report an issue: GitHub.