Is it possible to use conditions on Derived Attribute?

The example they give in the doc is friends.@count https://developer.apple.com/documentation/coredata/nsderivedattributedescription


But is it possible to count the number of friends based on a condition? Like if friend.gender=male.@count?

Is it possible to use conditions on Derived Attribute?
 
 
Q