Skip to main content

Unnest Dimensions

For multi-value fields, you can set the unnest property within a dimension. If true, this property allows multi-valued dimension to be unnested (such as lists) and filters will automatically switch to "contains" instead of exact match.

Example

In this example, the data contains an array column that has the value ['deal_one', 'deal_two', 'deal_three']. Setting the unnest property enables the user to filter on each value in the array. Metrics split by unnested values are non-additive, so that in this example the Total Impressions metric is applied equally across each value. Totals in Pivot Tables and the Time Dimension Detail view are calculated correctly, avoiding issues with "double counted" values when splitting multi-value dimensions.


 - label: "Deal Name"
column: deal_name
description: "Unnested Column"
unnest: true

In another example, we are provided with a directory_path column that gives us information on which path was editted. Using Duckdb regexp_split_to_array we have converted the string into an array. Using unnest, we can see which top directories are being updated more than others.


  - expression: regexp_split_to_array(directory_path, '/')
display_name: "The directory unnested"
description: "The directory path"
name: directory_path_unnested
unnest: true

Demo

See this project live in our demo!