Pivot Table

The Pivot Table widget enables the dynamic grouping and aggregation of object data and then displays this aggregated data in tabular form. Module builders configuring a Pivot Table widget can use features including:

  • Row-level grouping of data by one or more property types.
  • Column-level grouping of data by up to one property type.
  • Dynamic grouping of date and timestamp property types by date, week, month, and year.
  • Sorting by both row-level and column-level groupings.
  • Aggregations by count, cardinality, average, max, min, and sum.
  • Cell, row, and column-level selection to enable downstream filtering on selected group-by buckets.

The example below shows a configured Pivot Table widget displaying Flight Alerts data and filtering a downstream Object list widget:

pivot_table_example.png

Configuration options

The screenshot below shows the initial state (prior to configuration) of a Pivot Table widget; the widget's configuration panel shows the initial input Base object set set to Flight Alert: All:

pivot_table_empty_config.png

The Pivot Table widget has the following core configuration options:

  • Base object set: This parameter determines the Objects data passed into the Pivot Table and accepts an object set variable as input. Note that the Pivot Table only supports object set variables of a single object type.
  • Row grouping(s): The following options allow one or more row-level groupings to be added.
    • Add row grouping: Adds a row grouping by the selected property type.
    • Column width: Within each row grouping, adjusts the column width for the grouping property type.
    • Time interval: Within each row grouping for a date or timestamp property type, configures the bucketing time interval (such as exact date/time, week, month).
    • Show totals: Adds a Total row grouping to the bottom of the table. When multiple aggregations are used to calculate the column value, the Total value is the result of applying the same aggregations on the sum of original values of the property.
      • Disclaimer: The value that will appear in the Total row will be the result of performing the multi-step aggregation on all the raw values of the objects before each aggregation.
    • Sort rows: Enables sorting on one or more of the configured row grouping properties.
  • Column grouping: The following options allow up to one column-level grouping to be added.
    • Select a property: Adds a column grouping by the selected property type.
    • Time interval: Within each column grouping for a date or timestamp property type, configures the bucketing time interval (such as exact date/time, week, month).
    • Show totals?: Adds a Total column grouping to the right side of the table.
    • Sort values: Toggles sorting of column grouping values by ascending or descending order.
  • Aggregations: The following options control the aggregations displayed with the cells of the table.
    • Add aggregation: Allows a new aggregation on a property type or overall object count to be added.
    • Aggregation title: Clicking into an aggregation's title allows that title to be edited. The title chosen for each metric will appear on the table as a column header.
    • Aggregation metric: Controls how a given aggregation is calculated. Options include average, max, min, sum, count, or cardinality.
    • Column width: Adjusts the column width for a given aggregation.
  • Selected filter: This output object set filter variable captures the grouping criteria of user-selected cells and can be used to filter downstream widgets and object set variables. Users can select individual cells, groups of cells, or entire rows or columns.
  • On selection: Allows Workshop events (e.g. opening a drawer within the current module) to be triggered when a user selects something within the table. For more details, see the Workshop events documentation.