Try the attached. It takes 2 refreshes to update the second variable, so bear that in mind. If you are happy with it, you can add the second index for "No"
Update: I tested it on one match (2 markets). It might not work correctly with more markets loaded. I think then you might need to add a condition restricting it to the market_parent.