<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKWorkout/statistics(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKWorkout(im)statisticsForType:"
  },
  "title" : "statistics(for:)"
}
-->

# statistics(for:)

Returns the workout’s statistics for the provided quantity type.

```
func statistics(for quantityType: HKQuantityType) -> HKStatistics?
```

## Parameters

`quantityType`

The type of [`HKQuantitySample`](/documentation/HealthKit/HKQuantitySample) objects used to calculate the statistics.

## Discussion

HealthKit calculates an [`HKStatistics`](/documentation/HealthKit/HKStatistics) object based on the [`HKQuantitySample`](/documentation/HealthKit/HKQuantitySample) objects associated with the workout that also match the specified [`HKQuantityType`](/documentation/HealthKit/HKQuantityType).

If there are no matching quantity values, this method returns `nil`.

---

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)