0

I am trying to get some aggregated data from an OData endpoint V4 but before aggregating it I want to apply some filters. Here I have tried to set up the parameters separately but the aggregation is made for entire set of data

Products?$filter=(Category eq "Beverage")&$apply=aggregate(cost with sum as TotalCost)

However, I also tryed to put the filter in the $apply attribute as suggested in StackOverflow Question

Products?$apply=filter(Category eq "Beverage")\aggregate(cost with sum as TotalCost)

but I am getting the following error:

Cannot parse 'filter' in apply

ESCoder
  • 15,431
  • 2
  • 19
  • 42
Mugurel
  • 198
  • 10

1 Answers1

0

The query below should work
Products?$apply=filter(Category eq 'Beverage')/aggregate(cost with sum as TotalCost)
By the way which version .NET/.NET core and EF/EF Core are you using?