> ## Documentation Index
> Fetch the complete documentation index at: https://docs.evidence.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Dimension

> Add a dimension to a table, including date filtering, date grains, formatting, and more

```liquid theme={null}
{% table data="demo.daily_orders" %}
    {% dimension value="category" /%}
    {% dimension value="date" date_grain="month" title="Month" /%}
{% /table %}
```

## Examples

### Table with Dimensions

```liquid theme={null}
{% table data="demo.daily_orders" %}
    {% dimension value="category" /%}
    {% dimension value="date" date_grain="month" title="Month" /%}
{% /table %}
```

### With Image

```liquid theme={null}
{% table data="demo.daily_orders" %}
    {% dimension value="category" image="image_url" /%}
    {% measure value="sum(total_sales)" /%}
{% /table %}
```

### With Link

```liquid theme={null}
{% table data="demo.daily_orders" %}
    {% dimension value="category" link="concat('https://www.google.com/search?q=', category)" /%}
    {% measure value="sum(total_sales)" /%}
{% /table %}
```

### With Logo

```liquid theme={null}
{% table data="sales" %}
    {% dimension value="vendor" logo="domain" /%}
    {% measure value="sum(amount)" /%}
{% /table %}
```

### Conditional Colors

```liquid theme={null}
{% table data="demo.daily_orders" %}
    {% dimension value="category" conditional_colors="case when sum(total_sales) > 20000000 then '#22c55e' when sum(total_sales) > 10000000 then '#f59e0b' else '#ef4444' end" /%}
    {% measure value="sum(total_sales)" fmt="usd1m" /%}
{% /table %}
```

## Attributes

<ResponseField name="value" type="string" required />

<ResponseField name="title" type="string" />

<ResponseField name="align" type="string">
  **Allowed values:**

  * `left`
  * `center`
  * `right`
</ResponseField>

<ResponseField name="wrap" type="boolean">
  Whether to allow content in this dimension column to wrap across multiple lines
</ResponseField>

<ResponseField name="info" type="string" />

<ResponseField name="info_link" type="string">
  URL to link the info text to (can only be used with info)
</ResponseField>

<ResponseField name="info_link_title" type="string">
  Create a custom link title for the info link, placed after the info text (can only be used with info\_link)
</ResponseField>

<ResponseField name="hide" type="boolean" default="false">
  Whether to hide this column from the table display. Hidden columns are still included in queries and can be referenced by other columns.
</ResponseField>

<ResponseField name="html" type="boolean" default="false">
  Whether to render the dimension value as HTML
</ResponseField>

<ResponseField name="image_options" type="options group">
  Image display options (used when image prop is set)

  **Attributes:**

  * height: `number` - Height of the image in pixels
  * width: `number` - Width of the image in pixels
  * alt: `string` - Alt text for the image
  * hide\_label: `boolean` - Whether to hide the text label and show only the image
</ResponseField>

<ResponseField name="image" type="string">
  Column name or SQL expression containing the image URL for this dimension
</ResponseField>

<ResponseField name="logo" type="string">
  Column name or SQL expression containing the domain to look up a company logo for this dimension
</ResponseField>

<ResponseField name="logo_options" type="options group">
  Logo display options (used when logo prop is set)

  **Example:**

  ```
  logo_options={
    size = "sm"
    grayscale = true
    hide_label = true
  }
  ```

  **Attributes:**

  * size: `string` - Logo size: sm, base, lg, xl
    * **Allowed values:**
      * `sm`
      * `base`
      * `lg`
      * `xl`
  * grayscale: `boolean` - Display logo in grayscale
  * hide\_label: `boolean` - Whether to hide the text label and show only the logo
</ResponseField>

<ResponseField name="link" type="string">
  Column name or SQL expression containing the URL for linking this dimension
</ResponseField>

<ResponseField name="link_label" type="string">
  Static text to use as the link label instead of the cell content
</ResponseField>

<ResponseField name="link_new_tab" type="boolean" default="false">
  Whether to open the link in a new tab
</ResponseField>

<ResponseField name="date_grain" type="string">
  Bucket dates into a grain. Pass the raw date column as `x` and the chart truncates and groups for you. Temporal grains (`day`, `week`, `month`, `quarter`, `year`, `hour`) preserve the year — use for time-series. Seasonality grains (`day of week`, `day of month`, `day of year`, `week of year`, `month of year`, `quarter of year`) collapse across years — use for cyclical patterns like "which month sells most regardless of year".

  **Allowed values:**

  * `day`
  * `week`
  * `month`
  * `quarter`
  * `year`
  * `hour`
  * `day of week`
  * `day of month`
  * `day of year`
  * `week of year`
  * `month of year`
  * `quarter of year`
</ResponseField>

<ResponseField name="fmt" type="string">
  Format code for displaying dimension values (e.g., "yyyy" for years, "mmm" for months)
</ResponseField>

<ResponseField name="sort" type="string">
  Sort direction for this dimension column. When specified, the table will be sorted by this column.

  **Allowed values:**

  * `asc`
  * `desc`
</ResponseField>

<ResponseField name="column_group" type="string">
  Group name for this column. Columns with matching group names will be visually grouped under a shared header.
</ResponseField>

<ResponseField name="repeat_values" type="boolean">
  Whether to repeat this dimension value on every row. When true, the value is displayed on every row even when it is the same as the row above. Overrides the table-level repeat\_values setting for this dimension.
</ResponseField>

<ResponseField name="conditional_colors" type="string">
  SQL expression that returns color values for each row. Used to conditionally color dimension cells based on data (e.g., "case when count(\*) > 0 then '#22c55e' else null end").
</ResponseField>

## Allowed Parents

* [table](/components/table)
