Cell Summary

The Cell Summary Function allows you to see - at a glance - summary information about the cells (and rows) you have selected in AdapTable.

Simply select a group of cells and you can see the summary information about those cells in the Cell Summary Toolbar and / or Tool Panel

AdapTable ships with a large set of common Summary Operations.

note

If you have installed the Finance Plugin then extra finance-related Operations are available.

tip

You can provide your own Summary Operations in Cell Summary Predefined Config

AdapTable Cell Summary Operations

The following Cell Summary Operations are shipped with AdapTable:

OperationColumnsDescription
SumNumericTotal of all selected cells
AverageNumericAverage of all selected cells
MedianNumericMiddle (value) of all selected cells (when ordered)
ModeNumericMost common value
DistinctAllCount of distinct selected cell values
MaxNumericHighest selected Cell Value
MinNumericLowest selected Cell Value
CountAllNumber of selected cells

If using the Finance Plugin the additional Cell Summary Operations are available:

OperationColumnsDescription
OnlyNumericReturns true if all selected cells match (single column only)
VWapNumericRuns VWAP analysis - requires selection of 2 contiguous columns
WeightedAverageNumericCalculateds the Weighted Average - requires selection of 2 contiguous columns

Custom Cell Summary Definitions

Developers can add their own Cell Summary Definitions at design-time.

As with all instances where a JavaScript function needs to be provided to AdapTable, this is done in 2 steps:

note

Predefined Config is stored as JSON so cannot include JavaScript functions (as they cannot be stringifed)

  1. Provide a custom, named CellSummaryOperationFunction implementation in the User Functions section of Adaptable Options.

  2. Reference that function by name in the Cell Summary section of Predefined Config.

// Create a Custom Cell Summary definition called 'Oldest'
// which will reutrn the oldest date in a selection of date cells
// and store it in the User Functions section of Adaptable Options
const adaptableOptions: AdaptableOptions = {
userFunctions: [
{
type: 'CellSummaryOperationFunction',
name: 'OldestOperationFunction',
handler(operationParam) {
let dateValues: Date[] = [];
operationParam.selectedCellInfo.Columns.filter(
c => c.DataType === 'Date'
).forEach(dc => {
let gridCells = operationParam.selectedCellInfo.GridCells.filter(
gc => gc.columnId == dc.ColumnId
).map(gc => gc.rawValue);
dateValues.push(...gridCells);
});
if (dateValues.length > 0) {
const sortedDates = dateValues.sort((a, b) => {
return new Date(a).getTime() - new Date(b).getTime();
});
return new Date(sortedDates[0]).toLocaleDateString();
}
},
},
],
};
// Reference the OldestOperationFunction by name in Cell Summary Config
export default {
CellSummary: {
CellSummaryOperationDefinitions: [
{
OperationName: 'Oldest',
OperationFunction: 'OldestOperationFunction',
},
],
},
} as PredefinedConfig;

UI Elements

Cell Summary includes the following UI Elements:

  • Popup - Shows all the Cell Summary Operation results for the selected cells

  • Toolbar - Displays the result of the curently selected Cell Summary Operation (available through a dropdown). Choose a different item in the dropdown to see a different operation, or click on the 'info' button to see all the Operations.

  • Tool Panel - Same as Toolbar above.

  • Context Menu - See Cell Summary Menu Item opens Cell Summary popup (only visible if selected cells are editable).

Entitlements

Cell Summary Entitlement Rules:

  • Full: All Cell Summary Operations will be displayed (and can be selected)

  • Hidden: All Cell Summaries are hidden from the User

  • ReadOnly: N/A

FAQ

Can we add our own Summary Operations?

Yes, you need to provide a CellSummaryOperationDefinition in your Cell Summary Predefined Config.

Can we see Financial Operations?

Yes, if you use the AdapTable Finance Plugin

More Information