How to calculate two aggregations on same field within the same body?

Hello @gabriel_tessier,

So far, I have 2 different bodies with 2 different aggregations.

Queries for aggregations

I linked another post shown above. What I am trying to do is compare the results(sum) of the 2 aggregations. In this case, I want to know what the 2xx count is today compared to yesterday. If the count is decreasing, I wish to print a warning or some sort.

How can I accomplish this using elasticsearch (elasticsearch dsl)?