Run SQL pivot query
Run a SQL pivot query
Documentation Index
Fetch the complete documentation index at: https://lightdash-docs-deploy-vs-refresh-comparison.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Path Parameters
Body
Hidden pivot-column dimensions that are NOT sort targets but still need
their values carried through the SQL pipeline so that other fields'
richText / image: templates can reference them via
row.<table>.<field>.raw. They participate in group_by_query SELECT
and GROUP BY (same as sortOnlyDimensions) but do NOT affect
column_ranking ORDER BY (they don't drive sort). Without this bucket
the dim would be dropped entirely from the query and row.*.raw
references would silently resolve to undefined.
Dimensions referenced by ORDER BY but NOT spread into pivot columns.
Used when a user hides a dim that's part of pivotConfig.columns and has
a sort entry on it: the dim still ranks column order via the GROUP BY /
ORDER BY pipeline, but it doesn't become a pivot column header level.
Mirrors sortOnlyColumns (which serves the same purpose for metrics).
Metrics/table calculations needed for sort anchor CTEs but not for display. These are merged into valuesColumns for SQL generation in PivotQueryBuilder, but excluded from pivotDetails so they don't appear as chart series.
When true, metrics are displayed as rows instead of columns. This affects column limit calculation - when metrics are rows, we don't need to divide the column limit by the number of metrics. Defaults to false for backward compatibility (SQL runner behavior).
- object
- object[]