Hi @javi_landa ,
Seems you are struggling to build a logic for same. As per my understanding logic goes like :-
It goes like below :-
1. Start the main query activity on recipient table and selecting the people who are eligible.
2. To check if those exist in broadlog or not double check with any broadlog field for those records that that fields should be empty for same record as same record has not been targeted so there should not be any delivery associated with same customer.
3. Now use Test activity that records are more than 40000 or less than 40000, if more than 40k than you can simply go to delivery activity and use split before delivery activity for restricting the same to 40k.
4. If counts are less than 40k, then use one more query activity which will run in parallel using fork activity and from there you can pick the people whose broadlog exist and then using split to sort the population on basis of event date and then do union with actual population.
This is basic design, you can also use javascript to check the counts and based on counts we can pick the leftover population in main target.
I am happy to discuss more,
Regards
Abhishek