> [!CAUTION]
> **Caution:** **Under Construction:** We're working on adding more to this page. In the meantime, check out the [KPI (Single Value) chart options](https://docs.cloud.google.com/looker/docs/kpi-single-value-options.md.txt) documentation page or [single value (legacy) chart options](https://docs.cloud.google.com/looker/docs/single-value-options.md.txt) documentation page to view information about creating and editing single value visualizations by using the visualization options menu.

This page describes the parameters that are for use with LookML dashboard elements of `type: single_value` in a [`dashboard.lkml` file](https://docs.cloud.google.com/looker/docs/other-project-files#dashboard_files).

For information about building a single value chart through the Looker UI, see the [KPI (Single Value) chart options](https://docs.cloud.google.com/looker/docs/kpi-single-value-options.md.txt) documentation page or [single value (legacy) chart options](https://docs.cloud.google.com/looker/docs/single-value-options.md.txt) documentation page.

## Basic parameters

When defining a LookML dashboard element, you must specify values for at least the [`name`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#name) and [`type`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#type) parameters. Other basic parameters like [`title`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#title), [`height`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#height), and [`width`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#width) affect the position and appearance and position of an element on a dashboard.


### `name`

> This section refers to the `name` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element.md.txt).
>
> `name` can also be used as part of a dashboard filter, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#name-for-filters) documentation page.

Each `name` declaration creates a new dashboard element and assigns it a name.
Element names must be unique. Names are sometimes referenced in the
[`elements`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#elements-for-rows)
parameter when you're using
[`layout: grid`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout)
dashboards, or in the
[`group`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#group) parameter of
child elements when you're organizing elements into a tile group
(`type: group`).

    - name: orders_by_date

### `title`

> This section refers to the `title` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element.md.txt).
>
> `title` can also be used as part of a dashboard, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#title_(for_dashboard)) documentation page.
>
> `title` can also be used as part of a dashboard filter, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#title-for-filters) documentation page.

The `title` parameter lets you change how an element's name will appear to users. If unspecified, the title defaults to the element [`name`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#name-for-elements).

Consider this example:

    - name: sales_overview
      title: '1) Sales Overview'

If you used this format, instead of the element appearing as **Sales Overview** , it would appear as **1) Sales Overview**.

### `type`

> This section refers to the `type` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element.md.txt).
>
> `type` can also be used as part of a dashboard filter, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#type-for-filters) documentation page.
>
> `type` can also be used as part of a join, described on the [`type` (for joins)](https://docs.cloud.google.com/looker/docs/reference/param-explore-join-type.md.txt) parameter documentation page.
>
> `type` can also be used as part of a dimension, described on the [Dimension, filter, and parameter types](https://docs.cloud.google.com/looker/docs/reference/param-dimension-filter-parameter-types.md.txt) documentation page.
>
> `type` can also be used as part of a measure, described on the [Measure types](https://docs.cloud.google.com/looker/docs/reference/param-measure-types.md.txt) documentation page.

The `type` parameter determines the type of visualization to be used in the element.

    - name: element_name
      type: text | looker_grid | table | single_value | looker_single_record |
            looker_column | looker_bar | looker_scatter | looker_line | looker_area |
            looker_pie | looker_donut_multiples | looker_funnel | looker_timeline |
            looker_map | looker_google_map | looker_geo_coordinates | looker_geo_choropleth |
            looker_waterfall | looker_wordcloud | looker_boxplot | button | group

See the [`type` (for LookML dashboards)](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-type.md.txt) documentation page for an overview of the different types of LookML dashboard elements.

### `height`

> This section refers to the `height` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element.md.txt).
>
> `height` can also be used as part of a dashboard row, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#height-for-rows) documentation page.

#### For dashboards with `tile` or `static` layouts

The `height` parameter defines the height of an element, in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#tile_size) (which is defined in pixels), for [`layout: tile`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout) and [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout) dashboards.

For example, the following code specifies `tile_size: 100` and `height: 4`, making the `orders_by_date` element 400 pixels in height.

    - dashboard: sales_overview
      tile_size: 100
      ...

      elements:
      - name: orders_by_date
        height: 4
        ...

#### For dashboards with `newspaper` layout

The `height` parameter defines the height of an element, in units of [row](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#row), for [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout) dashboards.

A dashboard with newspaper layout defaults to an element height of 6 rows, or about 300 pixels. The minimum height is 1 row for dashboards with a [`preferred viewer`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#preferred_viewer) parameter set to `dashboards-next`. The minimum height is 2 rows for dashboards with a `preferred viewer` parameter set to `dashboards`.

For example, the following code sets an element to be 12 rows tall, or twice as tall as other elements that are set to the default:

    - dashboard: sales_overview
      layout: newspaper
      ...

      elements:
      - name: orders_by_date
        height: 12
        ...

### `width`

> This section refers to the `width` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element.md.txt).
>
> `width` can also be used as part of a dashboard, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#width-for-dashboard) documentation page.

The `width` parameter defines the width of an element, in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#tile_size), for [`layout: tile`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout) and [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout) dashboards.

For example, the following code specifies `tile_size: 100` and `width: 4`, making the `orders_by_date` element 400 pixels in width.

    - dashboard: sales_overview
      tile_size: 100
      ...

      elements:
      - name: orders_by_date
        width: 4
        ...

The `width` parameter defines the width of an element, in units of columns, for [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout) dashboards.

A dashboard with newspaper layout defaults to a width of 24 columns.

For example, the following code sets the element to half the width of the dashboard:

    - dashboard: sales_overview
      layout: newspaper
      ...

      elements:
      - name: orders_by_date
        width: 12
        ...


### `top`

The `top` parameter defines the top-to-bottom position of an element, in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#tile_size), for [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout) dashboards.

For example, the following code specifies `tile_size: 100` and `top: 4`, positioning the top edge of the `orders_by_date` element 400 pixels from the top of the dashboard.

    - dashboard: sales_overview
      tile_size: 100
      ...

      elements:
      - name: orders_by_date
        top: 4
        ...

### `left`

The `left` parameter defines the left-to-right position of an element, in units of [`tile_size`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#tile_size), for [`layout: static`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout) dashboards.

For example, the following code specifies `tile_size: 100` and `left: 4`, positioning the left edge of the `orders_by_date` element 400 pixels from the left side of the dashboard.

    - dashboard: sales_overview
      tile_size: 100
      ...

      elements:
      - name: orders_by_date
        left: 4
        ...

### `row`

For [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout)
dashboards, the `row` parameter defines the row that the top edge of an element
is placed on. If the element is placed inside a tile group by using the
[`group`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#group) parameter, `row`
defines the row position of the element relative to the top of the group
container (`row: 0`).

A dashboard begins with row 0 at the top of the dashboard. A dashboard with newspaper layout defaults to an element height of 6 rows, meaning the dashboard elements at the top of a dashboard (`row: 0`) would default to taking up rows 0-5.

Each row is 50 pixels tall, which means the default element height of 6 rows is 300 pixels.

For example, the following code sets an element to be set on the second row of elements in the dashboard, assuming elements are set at the default height:

    - dashboard: sales_overview
      layout: newspaper
      ...

      elements:
      - name: orders_by_date
        row: 6
        ...

### `col`

For [`layout: newspaper`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#layout)
dashboards, the `col` parameter defines the column that the left edge of the
element is placed on. If the element is placed inside a tile group by using the
[`group`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#group) parameter, `col`
defines the column position of the element relative to the left edge of the
group container (`col: 0`).

Dashboards are divided into 24 columns. A dashboard begins with column 0 at the left of the dashboard. A dashboard with newspaper layout defaults to an element width of 8 columns, meaning the dashboard elements at the left of a dashboard (`col: 0`) would default to taking up columns 0-7.

For example, the following code sets an element to be set in the third column of elements in the dashboard:

    - dashboard: sales_overview
      layout: newspaper
      ...

      elements:
      - name: orders_by_date
        col: 16
        ...

### `refresh`

> This section refers to the `refresh` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element.md.txt).
>
> `refresh` can also be used as part of a dashboard, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#refresh-for-dashboard) documentation page.

The `refresh` parameter allows an element to reload automatically on some periodic basis, thereby retrieving fresh data. This is often helpful in settings where a dashboard is constantly displayed, such as on an office TV. Note that the dashboard must be open in a browser window for this parameter to have an effect. This setting does not run in the background to "pre-warm" the dashboard cache.

The refresh rate can be any number (without decimals) of seconds, minutes, hours, or days. For example:

    - name: orders_by_date
      refresh: 2 hours

Use caution when setting short refresh intervals. If the query behind the element is resource-intensive, certain elements may strain your database more than desired.

### `note`

You can add descriptive notes to elements like this:

    - name: element_name
      note:
        text: 'note text'
        state: collapsed | expanded
        display: above | below | hover

`note` has the subparameters `text`, `state`, and `display`.

#### `text`

The `text` subparameter specifies the text displayed in the note. The text can be [localized](https://docs.cloud.google.com/looker/docs/model-localization.md.txt).

#### `state`

The `state` subparameter determines whether the note will be `collapsed` or `expanded` if it is too big to fit on a single row within the element's width. If you choose `collapsed` and the note is too long, the note will end in a clickable ellipsis (`...`) that can be used to read the full note.

#### `display`

The `display` subparameter determines where the note is displayed on an element. `above` places the note at the top of an element, `below` places it at the bottom of an element, and `hover` requires the user to hover their mouse over the element to see the note.

## Query parameters

When defining a LookML dashboard element, you must specify values for at least the [`model`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#model) and [`explore`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#explore) query parameters, and at least one field must be specified using either the [`dimensions`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#dimensions) parameter or the [`measures`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#measures) parameter. You can also use the other query parameters to control the way data is displayed in a dashboard element.

### `model`

The `model` parameter defines the model to use for the element query. If unspecified, it will default to the model where the dashboard resides.

    - name: orders_by_date
      model: ecommerce

The `model` parameter accepts [LookML constants](https://docs.cloud.google.com/looker/docs/reference/param-manifest-constant.md.txt). You can define a constant in the [manifest file](https://docs.cloud.google.com/looker/docs/other-project-files#project_manifest_files) for your project, then use the syntax `"@{constant_name}"` to set the constant as the value for `model`. Using a constant lets you define the name of a model in one place, which is particularly useful if you're updating the name of a model that is used by multiple dashboard elements.

For more information and an example of using constants with LookML dashboards, see the [`constant`](https://docs.cloud.google.com/looker/docs/reference/param-manifest-constant.md.txt#using_constants_in_lookml_dashboards) parameter documentation page.

### `explore`

> This section refers to the `explore` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element.md.txt).
>
> `explore` can also be used as part of a model, described on the [`explore`](https://docs.cloud.google.com/looker/docs/reference/param-explore-explore.md.txt) parameter documentation page.
>
> `explore` can also be used as part of a dashboard filter, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#explore-for-filters) documentation page.

The `explore` parameter defines the Explore to use for the element query.

    - name: orders_by_date
      explore: order

The `explore` parameter accepts [LookML constants](https://docs.cloud.google.com/looker/docs/reference/param-manifest-constant.md.txt). You can define a constant in the [manifest file](https://docs.cloud.google.com/looker/docs/other-project-files#project_manifest_files) for your project, then use the syntax `"@{constant_name}"` to set the constant as the value for `explore`. Using a constant lets you define the name of an Explore in one place, which is particularly useful if you're updating the name of an Explore that is used by multiple dashboard elements.

For more information and an example of using constants with LookML dashboards, see the [`constant`](https://docs.cloud.google.com/looker/docs/reference/param-manifest-constant.md.txt#using_constants_in_lookml_dashboards) parameter documentation page.

### `dimensions`

The `dimensions` parameter defines the dimension or dimensions to use for the element query. Use the syntax `view_name.dimension_name` to specify the dimension. Don't include `dimensions` if the query doesn't have any.

    ## single dimension example
    - name: orders_by_date
      dimensions: order.order_date

    ## multiple dimension example
    - name: orders_by_date
      dimensions: [order.order_date, customer.name]

### `measures`

The `measures` parameter defines the measure or measures to use for the element query. Use the syntax `view_name.measure_name` to specify the measure. Don't include `measures` if the query doesn't have any.

    ## single measure example
    - name: orders_by_date
      measures: order.count

    ## multiple measure example
    - name: orders_by_date
      measures: [order.count, order_item.count]

### `sorts`

The `sorts` parameter defines the sorting behavior for the element's query. List the primary sort field first, followed by any secondary sort fields. Use the `view_name.field_name` syntax to specify the dimension or measure to sort by.

If you omit the `sorts` parameter, the element uses Looker's [default sorting order](https://docs.cloud.google.com/looker/docs/creating-and-editing-explores.md.txt#sorting_data). Ascending sorts don't require a suffix, while descending sorts require the `desc` suffix.

The following example defines a single sort:

    - name: orders_by_date
      sorts: order.order_date desc

The following example defines multiple sorts:

    - name: orders_by_date
      sorts: [order.order_date desc, customer.name]

If you pivot dimensions, you can sort query results by specifying the measure name, the sort direction, and the 0-based index number of the target column in the data table. For example, the following element sorts by the first pivot column by using index `0`:

    - name: orders_by_category
      sorts: [orders.count desc 0]

To sort by the row total, specify the index of the totals column. For example, the following element sorts by the row total by using index `2`, which represents the totals column for a query with two pivot columns:

    - name: orders_by_cohort
      sorts: [users.count desc 2]

### `pivots`

The `pivots` parameter defines the dimensions that should be pivoted for the element query. Use the syntax `view_name.dimension_name` to specify the dimension. Don't include `pivots` if the query doesn't have any.

    ## single pivot example
    - name: orders_by_date
      pivots: customer.gender

    ## multiple pivot example
    - name: orders_by_date
      pivots: [customer.gender, customer.age_tier]

### `limit`

The `limit` parameter defines the row limit that should be used for the element query. The limit applies to the number of rows **before** any pivots are applied.

    - name: orders_by_date
      limit: 100

### `filters`

> This section refers to the `filters` parameter that is part of a [dashboard element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-element.md.txt).
>
> `filters` can also be used as part of a dashboard, described on the [Dashboard parameters](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#filters-for-dashboard) documentation page.
>
> `filters` can also be used as part of a measure, described on the [`filters`](https://docs.cloud.google.com/looker/docs/reference/param-field-filters.md.txt) parameter documentation page.

The `filters` parameter defines the non-changeable filters that should be used for the element's query. If you would like filters that a user *can* change in the dashboard, you should set up the filters using [`filters` for dashboards](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#filters-for-dashboard), then apply them to the elements using [`listen`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#listen).

The syntax for `filters` is:

    - name: element_name
      filters:
        orders.created_date: 2020/01/10 for 3 days
        orders.status: Shipped
        # You can create multiple filter statements

Each filter can accept a Looker [filter expression](https://docs.cloud.google.com/looker/docs/filter-expressions.md.txt) or a value constant. You can also use the [`_localization`](https://docs.cloud.google.com/looker/docs/model-localization.md.txt#filter_localization_example) or [`_user_attributes`](https://docs.cloud.google.com/looker/docs/liquid-variable-reference.md.txt#user_attributes) Liquid variables in the filter expression for flexible filter values.

### `listen`

Dashboard filters let viewers interactively refine the data that is shown in dashboard elements. Define dashboard filters with the [`filters` parameter for LookML dashboards](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#filters-for-dashboard). Then, use the `listen` parameter to link dashboard elements to the dashboard filter.

The syntax for `listen` is as follows:

    - name: element_name
      listen:
        filter_name_goes_here: dimension or measure on which to apply
                               the filter using view_name.field_name syntax
        # You can add more than one listen statement

Add the `listen` parameter to an element, and then provide the name of the filter followed by a colon and a reference to the field to which the filter should apply, using the `view_name.field_name` syntax. For example, you might create a filter called **Date** that requires a user to enter a date into the filter field in the UI. You could then apply the value that the user enters to the `orders_by_date` element like this:

    - dashboard: sales_overview
      ...

      filters:
      - name: date
        type: date_filter

      elements:
     - name: orders_by_date
        listen:
          date: order.order_date
        ...

If the filter being listened to is configured with the [`vis_filter: true`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#vis_filter) parameter, the filter control appears in a filter bar directly at the top of that visualization tile rather than in the top dashboard filter bar.

For additional examples of using the `filters` parameter and the `listen` parameter to apply dashboard filters to individual dashboard elements, see [Building LookML dashboards](https://docs.cloud.google.com/looker/docs/building-lookml-dashboards.md.txt#dashboard_filters).

### `query_timezone`

The `query_timezone` parameter specifies the time zone in which the query will be run. The time zone options are shown on the [Values for `timezone`](https://docs.cloud.google.com/looker/docs/reference/param-view-timezone-values.md.txt) documentation page. If you want the query to run using the viewer's time zone, you can assign the value as `user_timezone`.

    - name: orders_by_date
      query_timezone: America/Los Angeles

    - name: orders_by_customer
      query_timezone: user_timezone

### `merged_queries`

The `merged_queries` parameter lets you [combine the results of multiple queries](https://docs.cloud.google.com/looker/docs/merged-results.md.txt) into a single dashboard element. Define each source query within the element's `merged_queries` parameter and use the `join_fields`subparameter to specify [how the results should be merged](https://docs.cloud.google.com/looker/docs/merged-results.md.txt#checking_the_merge_rules_and_running_the_merge).

The following sample LookML code creates a merged results [element of `type: looker_grid`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-table-chart.md.txt). In this example, the `merged_queries` parameter is used to create a dashboard element that combines data from two separate queries into a single table chart:

```
- name: merged_results_element
  title: Merged Results Tile
  type: looker_grid
  merged_queries:
  - model: ecommerce
    explore: users
    type: table
    fields: [users.state, users.count, users.city]
    sorts: [users.count desc 0]
    limit: 5000
    column_limit: 50
    query_timezone: UTC
    listen:
    - State: users.state
  - model: ecommerce
    explore: users
    type: table
    fields: [users.state, users.city]
    sorts: [users.state]
    limit: 500
    column_limit: 50
    query_timezone: UTC
    join_fields:
    - field_name: users.state
      source_field_name: users.state
    - field_name: users.city
      source_field_name: users.city
    listen:
    - State: users.state
```

In this example, the dashboard element combines data from two source queries that are based on the `users` Explore in the `ecommerce` model. The primary query includes the `users.state`, `users.count`, and `users.city` fields, and it sorts the results by the `users.count` field. The second source query includes the `users.state` and `users.city` fields and sorts the results by the `users.state` field.

The `join_field` parameter merges the source queries based on matching values in the `users.state` and `users.city` fields.

The `listen` parameter applies a `State` filter to both queries, which lets dashboard viewers refine the query results that are displayed in the dashboard tile by selecting a specific state.

#### Example: Merging company data

Suppose you want to create a merged query that combines information about companies from two different Explores: `company_info` and `companies`. You want to join the queries on the `ipo.stock_symbol`, `companies.name`, and `companies.contact_email` fields from each Explore to create a query that returns results for company name, company contact email, IPO year, stock symbol, number of employees, and job count. You can define the merged query element in LookML as follows:

    - name: merged_results_element
      title: Merged Results Tile
      merged_queries:
      - model: market_research
        explore: company_info
        fields: [companies.name, companies.contact_email, ipo.public_year, ipo.stock_symbol]
        filters:
          companies.contact_email: "-NULL"
          ipo.valuation_amount: NOT NULL
        sorts: [ipo.public_year desc]
      - model: company_data
        explore: companies
        fields: [companies.name, ipo.stock_symbol, companies.contact_email,
          companies.number_of_employees, jobs.job_count]
        filters:
          companies.number_of_employees: NOT NULL
          ipo.stock_symbol: "-NULL"
          companies.contact_email: "-NULL"
        sorts: [jobs.job_count desc]
        join_fields:
        - field_name: ipo.stock_symbol
          source_field_name: ipo.stock_symbol
        - field_name: companies.name
          source_field_name: companies.name
        - field_name: companies.contact_email
          source_field_name: companies.contact_email

#### Applying filters to merged query elements

The [previous example of a merged query element](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#example:_merging_company_data) demonstrates how to apply hard-coded filters directly within each source query by using the [`filters`](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard-single-value-chart.md.txt#filters) parameter. For example, the filters `companies.contact_email: "-NULL"` and `ipo.valuation_amount: NOT NULL` in the primary query restrict the results to companies that have valid contact emails and valuations. These query-level filters pre-filter the data before merging the queries and cannot be changed by the user.

You can also apply [dashboard filters](https://docs.cloud.google.com/looker/docs/building-lookml-dashboards.md.txt#dashboard_filters) to merged query elements by using the `listen` parameter within the definition of each source query. For example, suppose you have a dashboard filter named `Industry` that you defined at the dashboard level by using the [`filters` parameter for LookML dashboards](https://docs.cloud.google.com/looker/docs/reference/param-lookml-dashboard.md.txt#filters-for-dashboard):

    filters:
    - name: Industry
      title: Industry
      type: field_filter
      ui_config:
        type: dropdown_menu
        display: inline
      model: market_research
      explore: company_info
      field: companies.industry

To apply the `Industry` filter to the `companies.industry` field in both source queries, add the `listen` parameter to each of the merged query's source query definitions as follows:

    listen:
      Industry: companies.industry

For example, the following sample code adds the `Industry` filter to both source queries in the merged results element from the previous example.

    - name: merged_results_element
      title: Merged Results Tile
      merged_queries:
      - model: market_research
        explore: company_info
        fields: [companies.name, companies.contact_email, ipo.public_year, ipo.stock_symbol]
        filters:
          companies.contact_email: "-NULL"
          ipo.valuation_amount: NOT NULL
        sorts: [ipo.public_year desc]
        listen:
          Industry: companies.industry
      - model: company_data
        explore: companies
        fields: [companies.name, ipo.stock_symbol, companies.contact_email,
          companies.number_of_employees, jobs.job_count]
        filters:
          companies.number_of_employees: NOT NULL
          ipo.stock_symbol: "-NULL"
          companies.contact_email: "-NULL"
        sorts: [jobs.job_count desc]
        join_fields:
        - field_name: ipo.stock_symbol
          source_field_name: ipo.stock_symbol
        - field_name: companies.name
          source_field_name: companies.name
        - field_name: companies.contact_email
          source_field_name: companies.contact_email
        listen:
          Industry: companies.industry

With this addition, when a user interacts with the `Industry` dashboard filter, the corresponding source query in the merged query element will be filtered accordingly.

> [!TIP]
> **Tip:** Each source query can listen to one or more dashboard filters. This lets you define filter logic for each source query independently, regardless of the number of source queries in your merged results element. If a query does not have a `listen` parameter, then it won't be affected by any dashboard filters.

### `hidden_fields`

The `hidden_fields` parameter indicates which fields, if any, are used in the query but hidden in the chart. Any hidden fields will appear in the data table section of an Explore.

    hidden_fields: [inventory_items.count, distribution_centers.id]

## Style parameters

This section describes the parameters that correspond to the options in the [**Style** section](https://docs.cloud.google.com/looker/docs/kpi-single-value-options.md.txt#style-menu-options) of the visualization editor for KPI (Single Value) and single value (legacy) charts.

### `colors`

The `colors` parameter specifies a list of colors for the series. The first color in the list corresponds to the first data series. If there are more series than listed colors, the colors will start over at the beginning.


    colors: [blue, orange, yellow, red, purple]

For all chart attributes that specify a color, the color value can take a hex string, such as `#2ca6cd`, or a [CSS named color string](https://www.w3schools.com/cssref/css_colors.asp), such as `mediumblue`.

### `custom_color_enabled`

Setting the `custom_color_enabled` parameter to `true` enables the option to specify a custom color for a single value visualization. Use this parameter with the `custom_color` parameter.


    custom_color_enabled: true | false

### `custom_color`

Specify a custom color for the text in a single value visualization.


    custom_color: #2ca6cd | mediumblue

### `show_single_value_title`

When this parameter is set to `true`, a title is displayed under the query's value. You can specify or change the title using the `single_value_title` parameter.


    show_single_value_title: true | false

### `single_value_title`

Specify a title to display with the query's value. The title text can be [localized](https://docs.cloud.google.com/looker/docs/model-localization.md.txt).


    single_value_title: Title

### `valueFormat`

Specify the number format or date format for the value. The parameter accepts [Excel-style formatting](https://support.office.com/en-us/article/create-or-delete-a-custom-number-format-78f2a361-936b-4c03-8772-09fab54be7f4?ui=en-US&rs=en-US&ad=US). If no formatting is specified, the value will be displayed in the format of the underlying dimension or measure.

## Comparison parameters

This section describes the parameters that correspond to the options in the [**Comparison** section](https://docs.cloud.google.com/looker/docs/kpi-single-value-options.md.txt#comparison-menu-options) of the visualization editor for KPI (Single Value) and single value (legacy) charts.

### `show_comparison`

When set to `true`, the `show_comparison` parameter lets you add comparison information to a dashboard element of `type: single_value`.


    show_comparison: true | false

### `comparison_type`

Use the `comparison_type` parameter to specify how the comparison field is used in a dashboard element of `type: single_value`.

You can specify one of the following values for the `comparison_type` parameter:

- `value`: The value of the comparison field is displayed at the bottom of the visualization.
- `change`: The value of the comparison field is displayed at the bottom of the visualization. If the value is negative, a triangle points downwards. If the value is positive, the triangle points upward.
- `progress`: The value of the field used for the single value visualization is divided by the comparison field's value. This percentage is displayed as a progress bar.
- `progress_percentage`: The value of the field used for the single value visualization is divided by the comparison field's value. This percentage is displayed as a progress bar. The bar is labeled with the percentage and the value of the comparison field.


    comparison_type: value | change | progress | progress_percentage

### `show_comparison_label`

Specify whether a label is shown with the comparison field. By default, the label is the name of the comparison field.


    show_comparison_label: true | false

### `comparison_label`

Specify the label to be displayed with the comparison field. The comparison label text can be [localized](https://docs.cloud.google.com/looker/docs/model-localization.md.txt).


    show_comparison_label: true
    comparison_label: Label

### `comparison_reverse_colors`

If `comparison_type` is set to `change`, you can set `comparison_reverse_colors` to `true` to display negative numbers in a comparison field as green text with a green triangle, while positive numbers appear as red text with a red triangle.


    comparison_type: change
    comparison_reverse_colors: true | false