Suppose I am querying a dataset called Sales
with the following schema:
id (int)
price (decimal)
active (bit)
Using the $apply
query option and the aggregate
transformation of the OData v4 spec, what would be the syntax for finding the average price for only active Sales?
$apply
supports both aggregation and filter transformations, but I can't figure out how to combine them or if you're even allowed to do so.
Thanks!
$apply=filter(Status eq 1)/aggregate(price with average as averagePrice)
maybe you can refer the existing test: