I am not certain what you mean by NC. Please define.
This is a concept called Rational Subgrouping. You want to include items in the subroup that are similar, but exclude items that are dissimimilar. In my experience, items from consecutive shots of the same cavity are more similar than items from multiple cavities in the same shot. That is: cavity-to cavity variation is usually greater than shot-to-shot variation. In fact, the different cavities often constitute different process streams. Mixing those different streams can increase the within subgroup variation. There are several ways that you can approach this. One would be to assume that the cavities are different and select your subgroup from consecutive shots from the same cavity. The second would be to perform a hypothesis test (e.g., ANOM, 1-way ANOVA) between cavities. If the cavities are not statistically different from each other, you may then safely select your subroup samples from those cavities within the same shot.