diff --git a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEnrollmentAnalyticsManager.java b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEnrollmentAnalyticsManager.java index a6e63c920f2..5dc97452ee7 100644 --- a/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEnrollmentAnalyticsManager.java +++ b/dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEnrollmentAnalyticsManager.java @@ -1263,7 +1263,7 @@ private void appendCteClause(StringBuilder sql, CTEContext cteContext) private void appendSelectClause(StringBuilder sql, EventQueryParams params, CTEContext cteContext) { List selectCols = ListUtils.distinctUnion( - params.isAggregatedEnrollments() ? List.of("enrollment") : COLUMNS, + params.isAggregatedEnrollments() ? List.of("enrollment") : getStandardColumns(), getSelectColumnsWithCTE(params, cteContext) );