<!--
{
  "availability" : [
    "iOS: 15.4.0 -",
    "iPadOS: 15.4.0 -",
    "macCatalyst: 15.4.0 -",
    "macOS: 13.0.0 -",
    "visionOS: -",
    "watchOS: 8.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKStatisticsQueryDescriptor/init(predicate:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "s:9HealthKit27HKStatisticsQueryDescriptorV9predicate7optionsAcA17HKSamplePredicateVySo16HKQuantitySampleCG_So0C7OptionsVtcfc"
  },
  "title" : "init(predicate:options:)"
}
-->

# init(predicate:options:)

Creates a statistics query descriptor.

```
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 [`HKStatisticsOptions`](/documentation/HealthKit/HKStatisticsOptions).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)