# Parameters

<Callout>
  Reports, Charts, Dashboards are intended to be created and modified through the
  user interface. The file representation is for checking errors during
  validation.
</Callout>

Parameters can be a part of [Report](/content/docs/reference/report), [Dashboard](/content/docs/reference/dashboard) or [Store](/content/docs/reference/model-store) files.

Store parameters schema is an array of [Store Filters](/content/docs/reference/model-store#store-filter).

Dashboard and Report parameters schema is an array of [Top Filters](/content/docs/reference/parameters#top-filter).

Dashboard tile parameters schema is an array of [Tile Parameter](/content/docs/reference/dashboard#tile-parameter).

Report row parameters schema is an array of [Row Parameter](/content/docs/reference/report#row-parameter).

One dashboard parameter can be applied to several tiles at the same time.
A tile parameter is only affected by a dashboard parameter if tile parameter has a **listen** pointing to dashboard parameter.

One report parameter can be applied to several rows at the same time.
A row parameter is only affected by a report parameter if the row parameter has a **listen** pointing to report parameter.

```yaml

# Report or Dashboard
parameters: 
# this filter can be listened by tiles or rows based on Malloy models
- filter: filter_name
  label: '...'
  description: '...' 
  result: filter_result
  suggest_model_dimension: field_path
  conditions:
  - 'filter expression'

# this filter can be listened by tiles or rows based on specified Store model
- filter: filter_name
  store_model: store_model_name
  store_result: store_result_name # filter can be mapped to fields that have specified result
  fractions:
  - logic: OR
    type: contains
    controls:
    - input: value_input
      value: a

# this filter can be listened by tiles or rows based on specified Store model
- filter: filter_name
  store_model: store_model_name
  store_filter: store_filter_name # filter can be mapped to specified store filter
  fractions:
  - controls:
    - selector: ga_property
      value: 123123123
    - date_picker: start_date
      value: $METRICS_DATE_FROM
    - date_picker: end_date
      value: $METRICS_DATE_TO
```

## Reference

### Top Filter

| Name                    | Type                     | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------------------- | ------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter\*                | string                   | -       | Filter name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| label                   | string                   | -       | Override filter name in UI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| description             | string                   | -       | Filter description in UI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| result                  | enum                     | -       | <ul><li>**string**</li><li>**number**</li><li>**boolean**</li><li>**ts** (timestamp)</li></ul> |
| store_model             | string                   | -       | Store name with "store_model\_" prefix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| store_result            | string                   | -       | Store result name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| store_filter            | string                   | -       | Store filter name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| suggest_model_dimension | string                   | -       | `for parameters mapped to Model Fields of type string` <br/> Suggest values ​​from the specified dimension for the filter if the user selects an "is equal to" or "is not equal to" filter expression                                                                                                                                                                                                                                                                                                                                                                             |
| conditions              | string []                | -       | `for parameters mapped to Model Fields and Filters` <br/> List of filter expressions that will be applied to this filter                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| fractions               | [Fraction []](#fraction) | -       | `for parameters mapped to Store Fields and Filters` <br/> Begin a section of fractions                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |

### Fraction

| Name     | Type                                                         | Default | Description                          |
| -------- | ------------------------------------------------------------ | ------- | ------------------------------------ |
| logic    | enum                                                         | -       | <ul><li>OR</li><li>AND_NOT</li></ul> |
| type     | string                                                       | -       | Store result type                    |
| controls | [Fraction Control []](/content/docs/reference/parameters#fraction-control) | -       | Begin a section of controls          |

### Fraction Control

| Name        | Type                    | Default | Description              |
| ----------- | ----------------------- | ------- | ------------------------ |
| input       | string                  | -       | Input control name       |
| switch      | string                  | -       | Switch control name      |
| selector    | string                  | -       | Selector control name    |
| date_picker | string                  | -       | Date_picker control name |
| value       | string, number, boolean | -       | Value                    |
