Set analysis is basically building a filter into an aggregation function. The two following expressions should evaluate to the same:
Set analysis is always faster. However, Set Analysis is like a selection that is applied before the aggregation. It cannot have different conditions on different lines in the aggregation. In such a case you need an If().