Grafana 9 alert when data missing after reduce

hi everybody! im not sure how to phrase it but i have this scenario:


i want to trigger an alert for main because it appears in $B but not in $A. how can i achieve this?