WOLFRAM

IncludeGroupAggregates
IncludeGroupAggregates

New in 14.2[Experimental]

is an option of PivotTable that specifies whether to add rows and columns with group aggregates.

Details

  • With the default setting IncludeGroupAggregatesFalse, aggregation summaries are not included.
  • With the setting IncludeGroupAggregatesTrue, PivotTable returns a Tabular object with additional rows and columns with key All or ExtendedKey[,All], containing aggregated information about groups of rows and columns.

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Take tabular data containing four columns:

Compute the mean age per "sex" and "class" groups, ignoring the "survived" column:

Out[2]=2

Include group aggregates for each column and each row:

Out[3]=3

Scope  (1)Survey of the scope of standard use cases

Make a pivot table showing the percent survival for the Titanic:

Out[1]=1

By default, PivotTable does not add group summaries:

Out[2]=2

Show group summaries, with a row and a column of key All:

Out[3]=3

Applications  (1)Sample problems that can be solved with this function

The data contains information on kidney transplant patientstime in days to death or on-study time since transplant at the given age:

Out[1]=1

Use the PivotTable to compute the patients' mean survival time in years split according to alive status versus gender and race, including the summary groups:

Out[2]=2
Wolfram Research (2025), IncludeGroupAggregates, Wolfram Language function, https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html.
Wolfram Research (2025), IncludeGroupAggregates, Wolfram Language function, https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html.

Text

Wolfram Research (2025), IncludeGroupAggregates, Wolfram Language function, https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html.

Wolfram Research (2025), IncludeGroupAggregates, Wolfram Language function, https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html.

CMS

Wolfram Language. 2025. "IncludeGroupAggregates." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html.

Wolfram Language. 2025. "IncludeGroupAggregates." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html.

APA

Wolfram Language. (2025). IncludeGroupAggregates. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html

Wolfram Language. (2025). IncludeGroupAggregates. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html

BibTeX

@misc{reference.wolfram_2025_includegroupaggregates, author="Wolfram Research", title="{IncludeGroupAggregates}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html}", note=[Accessed: 18-March-2025 ]}

@misc{reference.wolfram_2025_includegroupaggregates, author="Wolfram Research", title="{IncludeGroupAggregates}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html}", note=[Accessed: 18-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_includegroupaggregates, organization={Wolfram Research}, title={IncludeGroupAggregates}, year={2025}, url={https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html}, note=[Accessed: 18-March-2025 ]}

@online{reference.wolfram_2025_includegroupaggregates, organization={Wolfram Research}, title={IncludeGroupAggregates}, year={2025}, url={https://reference.wolfram.com/language/ref/IncludeGroupAggregates.html}, note=[Accessed: 18-March-2025 ]}