Assistance - Count in multiples Stages

Hello all, can you help me in my use case?
DHIS2 Tracker

I have several stages of a program, I would like to have the total of a specific stage, and with this total, I want to ask questions in other stages. How can I do this?

How many are in this stage, who have an event in another stage.