Dimension Grid
Dimension grid produces an interactive grid of one dimension tables, one for each string column in the source table. The dimension grid can can also be used as an input.
<DimensionGrid data={orders} metric='sum(sales)' name=selected_dimensions />
<LineChart data={monthly_sales} handleMissing=zero/>
Examples
Basic Usage
<DimensionGrid data={my_query} />
As an Input
Dimension grid produces a condition for all of the selected dimensions which is suitable for referencing directly in a where
or filter
clause. For example airline = 'Air Canada' and plane = '747
. Where no dimensions have been selected, DimensionGrid returns true
.
<DimensionGrid
data={my_query}
name="selected_dimensions"
/>
```sql filtered_query
select *
from source_name.table
where ${inputs.selected_dimensions}
```
Multi Select
Using the multiple prop, Dimension grid can filter by multiple rows in the same column. Default value is false
<DimensionGrid
data={orders}
metric='sum(sales)'
name=multi_dimensions
multiple
/>
<LineChart data={monthly_sales_multi} y=sales_usd0/>
```monthly_sales_multi
select
order_month,
sum(sales) as sales_usd0
from needful_things.orders
where ${inputs.multi_dimensions}
group by all
```
Options
Query name, wrapped in curly braces
- Options:
- string
SQL aggregate which could be applied to data
e.g. 'sum(sales)'
- Options:
- string
Name of the dimension grid, used to reference the selected value elsewhere as {inputs.name}
- Options:
- string
Label for the metric
- Options:
- string
Sets format for the value (see available formats)
- Options:
- Excel-style format | built-in format | custom format
Maximum number of rows to include in each table
- Options:
- number
Allows for multiple rows in a column to be selected and filtered
- Options:
- boolean