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

# Get a single value metric

> Fetch one value for a whole date range, overall or per group, with threadSingleValueMetric.

`threadSingleValueMetric` returns one value for the whole date range, such as median resolution time this month or SLA compliance this quarter. With `groupBy`, it returns one value per group, which suits tables and leaderboards.

<Snippet file="graphql/sdk-note.mdx" />

This query requires the `metrics:read` permission, or `metricsAgent:read` for `agent_` metrics. See [Permissions](/docs/graphql/reporting#permissions).

## Get a single value

`input` takes these fields:

* **`metricName`**: any single value metric from the [metrics reference](/docs/graphql/reporting/metrics)
* **`from`** and **`to`**: the date range, in UTC. Required for every metric except `threads_all_time_count_done`, which rejects them. Both are widened to whole hours
* **`mode`**: `METRIC` for values, or `THREAD_IDS` for the threads behind them
* **`percentile`**: for duration metrics, an integer from 1 to 99. Defaults to 50
* **`filters`** and **`groupBy`**: see [Filter and group reporting queries](/docs/graphql/reporting/filters)

This query returns each user's median resolution time for September:

<Snippet file="graphql/get-thread-single-value-metric.mdx" />

## Read the response

`values` has one entry per group, or a single entry when there's no `groupBy`. Each entry has a `value` and a `group`. `value` is `null` when the group had no data in the range. Entries aren't sorted, so sort them yourself.

## Get the threads behind a value

Set `mode` to `THREAD_IDS` to get the distinct IDs of the threads behind the value in `threadIds`. `values` is `null` in this mode, and `groupBy` isn't allowed, so add a group as a filter to get its threads.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.