<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKQuantitySample/quantity",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKQuantitySample(py)quantity"
  },
  "title" : "quantity"
}
-->

# quantity

The quantity for this sample.

```
@NSCopying var quantity: HKQuantity { get }
```

## Discussion

If the sample contains more than one quantity, this property returns the sum or average, depending on the sample’s aggregation style (sum for cumulative, average for discrete). To access the individual quantities, use an [`HKQuantitySeriesSampleQuery`](/documentation/HealthKit/HKQuantitySeriesSampleQuery).

To see the type of units compatible with this quantity, look up the sample’s quantity type identifier in [`HKQuantityTypeIdentifier`](/documentation/HealthKit/HKQuantityTypeIdentifier).

---

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)