---
title: HKPredicateKeyPathQuantity
framework: healthkit
role: symbol
role_heading: Global Variable
path: healthkit/hkpredicatekeypathquantity
---

# HKPredicateKeyPathQuantity

The key path for accessing the sample’s quantity.

## Declaration

```swift
let HKPredicateKeyPathQuantity: String
```

## Discussion

Discussion Use this constant whenever you want to include a sample’s quantity in a predicate format string. Add a %K placeholder to the format string, and then pass this constant as an argument. Alternatively, use the predicateForQuantitySamples(with:quantity:) method to create predicates that match a sample’s quantity.

## See Also

### Specifying Predicate Key Paths

- [HKPredicateKeyPathCount](healthkit/hkpredicatekeypathcount.md)
