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

# Dynamically displaying tile fields with controls

> Let dashboard viewers switch which fields appear in a tile using controls, enabling period-over-period comparisons and field swaps.

Controls allow you to choose which fields will be shown in a tile.

## Requirements

Creating and modifying controls requires **Editor**, **Manager**, or **Owner** permissions on the document.

## Creating dashboard controls

To add a control to the dashboard, go into edit mode and click **Add > Control** in the toolbar. Configuring a control asks that you start by picking one of the underlying fields common to the tiles you want to control. Otherwise the control will have no impact (e.g. adding a field switcher between "order volume" and "total sales" to a tile that is showing "user count" will have no impact).

Like filters, when you are editing the control you can pick which tiles on the dashboard to connect by toggling the icon in the top right of each tile. You can also set default values and optionally hide the control from dashboard viewing.

## Control types

| Type                                                                         | Description                                                                                      |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| <Icon icon="shuffle" /> [**Field switcher**](#field-switcher)                | Swaps a single field for another within the same query                                           |
| <Icon icon="list-check" /> [**Multi-field picker**](#multi-field-picker)     | Selects one or more fields to show in a chart                                                    |
| <Icon icon="calendar-days" /> [**Timeframe switcher**](#timeframe-switcher)  | Controls the granularity of a date grouping                                                      |
| <Icon icon="timeline" /> [**Period over period**](#period-over-period)       | Compares metrics between time periods                                                            |
| <Icon icon="users-between-lines" /> [**Parent**](#parent)                    | Controls the toggling of multiple controls                                                       |
| <Icon icon="arrow-left-arrow-right" /> [**Dynamic filter**](#dynamic-filter) | Allows dashboard viewers to add filters to a published dashboard                                 |
| <Icon icon="ranking-star" /> [**Top N limit**](#top-n-limit)                 | Enables change the number of values (N) on a [Top N field](/analyze-explore/custom-fields/top-n) |

<h3 id="field-switcher">
  Field switcher controls
</h3>

Field switcher controls allow dashboard viewers to swap a single field for another field within the underlying query. When used with dimensions, this will change the grouping or breakdown of a query. For example, a field switcher with dimensions like `country`, `gender`, and `age group` allows viewers to slice the metrics in the connected tiles in different ways. When used with measures, the metric to be displayed in the connected charts will update.

Field switcher controls can have any number of fields. Typically field switchers are either all measures or dimensions, but they can be mixed. You can also add a `no field` option, which is useful when you want to offer viewers a way to see the total metric value or pick a dimension to change the grouping.

<Tip>
  The default field in a field switcher must be included as a field in your underlying query. 
</Tip>

<h3 id="multi-field-picker">
  Multi-field picker controls
</h3>

A multi-field picker control allows you to pick zero or more fields to show in a chart. While usually most useful on table visualizations, it can be connected to any chart tile on the dashboard.

<h4 id="multi-field-reordering">
  Enable field reordering for viewers
</h4>

Use the **Control manages field order** setting in the properties panel to let dashboard viewers to reorder fields they select from the control:

* **When enabled**, fields appear in the order they're selected in the control, even if the underlying query already includes them. Sorts, subtotals, pivots, fills, and transposition settings are preserved.

  **Note**: Measures cannot be placed between dimensions. If this occurs during field selection, Omni will automatically reorder the fields to place dimensions first, then measures.
* **When disabled**, fields already in the query keep their position and the control only adds or removes fields.

<h3 id="timeframe-switcher">
  Timeframe switcher controls
</h3>

For date fields, you may want to provide a control to allow the viewer to change the granularity of the date grouping. For example, change a grouping from months to weeks or to days. Time frame switchers make this easy. When configuring, select the underlying date field to control and then select the time frames you want to make available.

<h3 id="period-over-period">
  Period over period controls
</h3>

To compare a metric between time periods, use a period over period control. When configuring, select the underlying date field that controls the time periods you want to compare. Choose the current period and one or more comparison periods. Any attached charts will break down the metric between the current and previous time period(s).

<img src="https://mintcdn.com/omni-e7402367/-tqhX6I5Gu-LUQ5_/visualize-present/images/dashboard-controls.png?fit=max&auto=format&n=-tqhX6I5Gu-LUQ5_&q=85&s=099934e85a51b3316596b200a5b5a25b" alt="" width="2192" height="1158" data-path="visualize-present/images/dashboard-controls.png" />

#### Mapping period over period controls to tiles

Period over period controls can only be applied to tiles that have queries with matching period over period computations. When editing a period over period control, Omni will disable the mapping option for tiles that don't include period over period computations and display a message in the properties panel.

If you need to apply a period over period control to a tile, ensure the underlying query includes period over period computations before attempting to map the control.

<h3 id="parent">
  Parent controls
</h3>

A parent controls coordinates the toggling of multiple controls at once. For example, consider a dashboard has a timeseries with a `created_at` date, another timeseries with a `received_at` date, and a timeseries with a `returned_at` date.

To coordinate the multiple timeseries fields, you would:

1. Build three timeframe switchers.
2. Add a parent control.
3. Configure the parent control's display options and connect the timeframe switchers as children.
4. Hide the child timeframe switchers.

<iframe className="w-full aspect-video rounded-xl" src="https://player.vimeo.com/video/982720328?badge=0\&autopause=0\&player_id=0\&app_id=58479" title="Dashboard Parent Controls" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

<h3 id="dynamic-filter">
  Dynamic fiilter controls
</h3>

Dynamic filter controls let viewers add their own filters to a published dashboard without the creator having to predefine every filter option. This enables ad-hoc exploration while giving creators control over which fields viewers can filter on. See [Dynamic filter controls](/visualize-present/dashboards/dynamic-filter-controls) for more information.

<h3 id="top-n-limit">
  Top N limit controls
</h3>

This control type allows dashboard viewers to change the number of values (N) on a [Top N field](/analyze-explore/custom-fields/top-n). Create the control and then map it directly to an existing Top N field in the tile's query.

<Warning>
  This control only works when mapped to a field that already has Top N configured. If the Top N field isn't present in the tile's query, the control will not do anything, including showing as disabled.

  If the field is present but isn't actually a Top N field, the tile's query will break. Omni's [content validator](/modeling/develop/content-validator) doesn't check this mapping - verify it manually after renaming or removing fields.
</Warning>
