The grid (core) ยท console.warn
compareGroups needs a "by" column to split the rows into two groups.
Printed by The grid (core), prefixed [lattice], since 1.27.0.
Warnings reference › compareGroups:by
- Identifier
compareGroups:by- Raised by
- The grid (core)
- Since
- 1.27.0
What happened
compareGroups compares one measure across two groups of rows, and the by column is what splits them. Without it there is nothing to compare and the call returns null.
The fix
Name the grouping column in by.
The smallest fix
grid.statistics.compareGroups({ col: 'revenue', by: 'variant' });
Reference
Covered in full at the API reference.