Mismatched aggregation error

Could anyone tell me what’s wrong with the following code? Total order revenue is an aggregated (SUM) field, the other fields are non-aggregated!

ifelse({order star rating} <= 3 AND {Total Order Revenue} > 5000 AND {Sales Period Date} >= parseDate(‘2022-04-01’), ‘3+’, toString({order star rating}))

It threw a Mismatched Aggregation error


From our documentation

Custom aggregations can’t contain both aggregated and nonaggregated fields, in any combination. For example, this formula doesn’t work: Sum(sales)+quantity.

You can find more information on the documentation about Aggregate functions