Math on reduced prometheus time series


I’m using Grafana v9.1.3, self-hosted and my case is the following. I’m using two Prometheus time series:

Query A

Query B

Each query return 9 TS with the same labels made of a status and a country.
On each of them I use a reduce expression (query C & D) to keep last value.This returns for each expression 9 values with the labels status and country.

For the alerting purpose I want to check with a math expression (query E) when $C == -1 && $D == 1 (literally when an account goes from “Complete” to “Enabled”). This doesn’t work as the result is No data.

I guess math expression is unable to match the reduced expressions based on labels ? Is there a way to do it ?