---
title: "init(predicate:options:)"
framework: healthkit
role: symbol
role_heading: Initializer
path: "healthkit/hkstatisticsquerydescriptor/init(predicate:options:)"
---

# init(predicate:options:)

Creates a statistics query descriptor.

## Declaration

```swift
init(predicate: HKSamplePredicate<HKQuantitySample>, options: HKStatisticsOptions)
```

## Parameters

- `predicate`: A predicate that defines the set of data that the query uses to calculate the statistics.
- `options`: A list of options that define the type of statistical calculations performed and the way in which HealthKit merges data from multiple sources. For a list of valid options, see doc://com.apple.healthkit/documentation/HealthKit/HKStatisticsOptions.
