Skip to content

Commit 1909fac

Browse files
authored
fix: DH-19138: Determine Totals Column Name by Num Aggs Per Column (#2411)
https://deephaven.atlassian.net/browse/DH-19138 For totals table columns, we were applying renaming logic based on number of operations in the config, but it should be on number of operations for each given column. E.g., for a config `{X : [SUM, COUNT], Y: [COUNT]}` then your columns will be `[X_SUM, X_COUNT, Y]` but we were expecting `[X_SUM, X_COUNT, Y_COUNT]`
1 parent 15c8cfe commit 1909fac

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/iris-grid/src/IrisGridTableModelTemplate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,13 +1011,13 @@ class IrisGridTableModelTemplate<
10111011
const tableColumn = this.columns[column];
10121012

10131013
// Find the matching totals table column for the operation
1014-
// When there are multiple aggregations, the column name will be the original name of the column with the operation appended afterward
1015-
// When the the operation is the default operation OR there is only one operation, then the totals column name is just the original column name
1014+
// When there are multiple aggregations for the column, the column name will be the original name of the column with the operation appended afterward
1015+
// When the the operation is the default operation OR there is only one operation for the column, then the totals column name is just the original column name
10161016
const totalsColumn = this.totalsTable?.columns.find(
10171017
col =>
10181018
col.name === `${tableColumn.name}__${operation}` ||
10191019
((operation === defaultOperation ||
1020-
this.totals?.operationOrder.length === 1) &&
1020+
this.totals?.operationMap[col.name]?.length === 1) &&
10211021
col.name === tableColumn.name)
10221022
);
10231023
if (totalsColumn != null) {

0 commit comments

Comments
 (0)