Skip to content

Conversation

@nishantmonu51
Copy link
Collaborator

@nishantmonu51 nishantmonu51 commented Dec 11, 2025

Notion PRD here. The Notion PRD should serve as the source of truth for this feature.

https://www.notion.so/rilldata/Pivot-row-limit-for-nested-dimensions-2c7ba33c8f5780ff8ddfdd9fd94cfeda?source=copy_link

Add row limit control to pivot tables

This PR adds a configurable row limit feature to pivot tables, allowing users to control how many child rows are displayed under each dimension.

Changes

UI Components:

  • Added "Row limit" dropdown selector in pivot toolbar with options: 5, 10, 25, 50, 100, All
  • Only visible in pivot table mode (not flat table mode)
  • Includes tooltip explaining the limit applies to child rows under each dimension

State Management:

  • Added rowLimit?: number field to PivotState (undefined = unlimited)
  • Created setPivotRowLimit reducer that resets pagination, expanded state, and active cell when limit changes
  • Integrated row limit into URL state for sharing/bookmarks via row_limit parameter

Data Queries:

  • Applied limit to all data-fetching queries:
    • Column dimension axes
    • Row dimension axes
    • Table cell data
    • Expanded row data
    • Measure totals for sorting

pivot-limit
Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@medriscoll
Copy link
Contributor

{#if !isFlat}
<Tooltip location="bottom" alignment="start" distance={8}>
<div class="row-limit-dropdown pointer-events-auto">
<span class="row-limit-label">Row limit</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has the wrong font size and color

placeholder="Row limit"
/>
</div>
<TooltipContent slot="tooltip-content">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tooltip should anchor on the label and not the dropdown as it would overlap the first dropdown option

@mindspank
Copy link
Contributor

When navigating from Pivot -> Explore -> Pivot we lose the limit setting

@mindspank
Copy link
Contributor

several issues with expanded rows and limits:

  • When changing limit with a expanded row, it does not work
  • When changing limit it re-renders the table and thus also closes any expanded rows, they need to stay open

@mindspank
Copy link
Contributor

It seems export is broken, it does no longer sort on the measure

@mindspank
Copy link
Contributor

totals are not respecting limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants