Skip to main content

Pivot Transform

With Pivot, unique values from one column become headers in a wider table, while another column provides the values beneath them.

Basic Usage​

To build a pivoted table:

  1. Select Pivot from the transform menu.
  2. Choose the columns that group the output rows.
  3. Select the column whose values should become new headers.
  4. Select the column that supplies the pivoted values.
  5. Choose an Aggregation Method and, if needed, a Fill Value.

Configure and apply a Pivot Table transform

Configuration Options​

Basic Options​

  • Group Rows By: Select one or more columns that identify an output row.
  • Create New Columns From: Select the column whose unique values will become headers.
  • Values for New Columns: Select the column that will fill the pivoted cells.

Advanced Options​

  • Aggregation Method: Choose how to combine multiple values that land in the same pivoted cell:

    • Mean
    • Sum
    • Count
    • First
    • Last
    • Min
    • Max
Text values and aggregation methods

Sum, Mean, Min, and Max require a numeric Values for New Columns column. If you use one of them with a text column, Rhombus displays a warning and disables Apply.

For text values, choose Count, First, or Last. Use First when the pivoted cells should contain text instead of a count.

  • Fill Value: Enter the value to place in empty pivot cells.

Limits and Processing Time​

  • Pivot columns: Create New Columns From can contain no more than 1,000 unique, non-null values.
  • Estimated pivot cells: The number of unique, non-null Create New Columns From values multiplied by the number of unique Group Rows By combinations cannot exceed 5,000,000.
  • Runtime threshold: Based on the estimated cell count, the backend sets a threshold between 10 and 120 seconds. Exceeding it produces a timeout error, but does not forcibly stop the worker thread. The request may still wait for the pivot to finish before returning the error.

Examples​

Example 1: Basic Pivot

Input Dataset:

DateStoreProductSales
2024-09-01Store AProduct 1100
2024-09-01Store AProduct 2150
2024-09-02Store BProduct 190
2024-09-02Store BProduct 2130

Configuration:

  • Group Rows By: Store
  • Create New Columns From: Product
  • Values for New Columns: Sales
  • Aggregation Method: Sum
  • Fill Value: 0

Result:

StoreProduct 1Product 2
Store A100150
Store B90130
Example 2: Multi-Index Pivot

Input Dataset:

DateStoreProductSales
2024-09-01Store AProduct 1100
2024-09-01Store AProduct 2150
2024-09-02Store BProduct 190
2024-09-02Store BProduct 2130
2024-09-03Store AProduct 1120

Configuration:

  • Group Rows By: Date, Store
  • Create New Columns From: Product
  • Values for New Columns: Sales
  • Aggregation Method: Sum
  • Fill Value: 0

Result:

DateStoreProduct 1Product 2
2024-09-01Store A100150
2024-09-02Store B90130
2024-09-03Store A1200
tip

When several rows map to the same pivot cell, use an aggregation method that makes sense for the value column.

caution

A pivot can create many columns. Filter or group high-cardinality values first to stay within the limits and keep the output readable.

Best Practices​

  1. Choose Group Rows By columns that clearly identify each output row.
  2. Use Sum, Mean, Min, or Max for numeric values. Count, First, and Last also work for non-numeric values; First is usually the clearest option for text.
  3. Pick a deliberate Fill Value, such as 0 for numbers or Unknown for categories.
  4. Preview the output, especially when Create New Columns From has many unique values.