Skip to content

Sorting And Filtering

Sorting and filtering in Pivot operate on analytical members and generated measures, not on the final rendered cells alone. The same ideas exist in both client-side and server-side Pivot, but the execution layer is different.

Client-side Pivot uses dimension metadata when generating row and column members.

Relevant dimension options:

  • sortable
  • order

If a Pivot column dimension is marked sortable, generated members for that dimension are ordered using the configured comparer and sort direction.

Generated value columns inherit configured filter metadata from their dimensions, so the resulting grid can expose filter-ready columns. This is still based on the generated Pivot output, not on the raw fact table semantics of a remote analytical engine.

In client mode:

  • row hierarchy ordering comes from the grouped source data
  • column hierarchy ordering comes from the configured dimension metadata
  • measure cells are results of aggregation, not independently sorted records

In server mode:

  • filter expressions are part of PivotLoadRequest.loadOptions.filter
  • sort directives are part of PivotLoadRequest.loadOptions.sort
  • the analytical engine is responsible for applying them before returning the visible window

That distinction matters because server-side Pivot should sort and filter the cube window, not just the already-rendered grid cells.

The remote request contract also supports sort-by-summary semantics through bySummary on sort descriptors. Use that when your backend can rank groups by a measure rather than only by a dimension label.

  • Keep client-side sorting expectations simple: it orders generated members, not facts.
  • Use remote/server-side filtering for large datasets or security-sensitive selectors.
  • Do not rely on client-generated columns as the trust boundary for secure filtering. The field registry belongs on the server side.

Continue with Plugin Lifecycle to see how Pivot owns and restores grid state.