Disclaimer Chatgpt helped med writh much of this but the text says what I want it to, Description: Currently, the aggregation.aggregate action in CAS requires separate runs to produce multiple grouping levels (e.g., detail rows plus totals by a subset of the groupBy variables). Unlike other SAS aggregation tools (such as PROC MEANS with the WAYS statement), there is no built-in way to produce hierarchical roll-ups or all-combinations totals in a single execution. Proposed Enhancement: Introduce an parameter in aggregation.aggregate bygroup parameter similar to ALL in proc tabulate or the capabilities like PROC MEANS WAYS statement. Alternativly, parameters such as this below could be an alternative. Use case: Performance: Potentially reduces the need for multiple passes over large CAS tables to generate totals at different levels, which saves CPU, memory, and I/O. Convenience: Aligns the CAS Aggregation.aggregate action with PROC MEANS / PROC SUMMARY capabilities, reducing the learning curve for SAS users transitioning to CAS actions. Scalability: Particularly beneficial for large public-sector or healthcare datasets where multiple aggregation levels are needed for reporting and policy analysis, and where processing time is critical. To my knowledge, the CAS Aggregation.aggregate action is the only way to realtivly easeley calculate rolling window statistics (such as rolling 12 months) of the NDISTICT statistica. Combining this with the possibility to easily calculate group totals of statistics would be very useful. Example Use Case: Aa analytics team needs: Detailed monthly counts by department, sub-benefit, gender, decision outcome. Totals by gender across all other variables. Totals by department only. Grand total. Today, these require multiple aggregation.aggregate calls and post-processing merges. With some sort of by group total parameter, all could be produced in a single action step. Currently I have been able to simulate this usinf Cas arrays and formats, but the numbers of needed dimensions in the array grow exponentially with the number of variable you need to have totals for, eventuall becoming unweildly.
... View more