---
title: "predicateForWorkouts(with:totalEnergyBurned:)"
framework: healthkit
role: symbol
role_heading: Type Method
path: "healthkit/hkquery/predicateforworkouts(with:totalenergyburned:)"
---

# predicateForWorkouts(with:totalEnergyBurned:)

Returns a predicate for matching workouts based on the total energy burned.

## Declaration

```swift
class func predicateForWorkouts(with operatorType: NSComparisonPredicate.Operator, totalEnergyBurned: HKQuantity) -> NSPredicate
```

## Parameters

- `operatorType`: The operator type to use when comparing the total energy burned.
- `totalEnergyBurned`: The target amount of energy burned.

## Return Value

Return Value A predicate for matching workouts based on the total energy burned. This predicate works only on workouts.

## Discussion

Discussion Use this convenience method to create a predicate that matches against a workout’s total energy burned. The following sample uses both the convenience method and a predicate format string to create equivalent predicates.

## See Also

### Related Documentation

- [HKPredicateKeyPathWorkoutTotalEnergyBurned](healthkit/hkpredicatekeypathworkouttotalenergyburned.md)
- [totalEnergyBurned](healthkit/hkworkout/totalenergyburned.md)

### Creating workout predicates

- [predicateForObjects(from:)](healthkit/hkquery/predicateforobjects(from:)-5irg9.md)
- [predicateForWorkouts(with:)](healthkit/hkquery/predicateforworkouts(with:).md)
- [predicateForWorkouts(activityPredicate:)](healthkit/hkquery/predicateforworkouts(activitypredicate:).md)
- [predicateForWorkouts(with:duration:)](healthkit/hkquery/predicateforworkouts(with:duration:).md)
- [predicateForWorkouts(operatorType:quantityType:averageQuantity:)](healthkit/hkquery/predicateforworkouts(operatortype:quantitytype:averagequantity:).md)
- [predicateForWorkouts(operatorType:quantityType:maximumQuantity:)](healthkit/hkquery/predicateforworkouts(operatortype:quantitytype:maximumquantity:).md)
- [predicateForWorkouts(operatorType:quantityType:minimumQuantity:)](healthkit/hkquery/predicateforworkouts(operatortype:quantitytype:minimumquantity:).md)
- [predicateForWorkouts(operatorType:quantityType:sumQuantity:)](healthkit/hkquery/predicateforworkouts(operatortype:quantitytype:sumquantity:).md)
- [predicateForWorkouts(with:totalDistance:)](healthkit/hkquery/predicateforworkouts(with:totaldistance:).md)
- [predicateForWorkouts(with:totalFlightsClimbed:)](healthkit/hkquery/predicateforworkouts(with:totalflightsclimbed:).md)
- [predicateForWorkouts(with:totalSwimmingStrokeCount:)](healthkit/hkquery/predicateforworkouts(with:totalswimmingstrokecount:).md)
