Use JSONata aggregation to return the results of values to find a maximum, minimum, or average value in an array.
Be careful when using complex expressions, such as expressions that iterate one datasource across another, as your solution performance could become slower. To avoid this, try to use the datasource queries to get the desired result rather than an expression.
In this example static data is agregated in a component.enity to show the result in the entity field.
See the full example code sample in GitHub.