I have data that looks like this:
Associate ReferredBy SalesQty ReferralSales
Alice Bob 50
Bob Carl 60
Carl NULL 70
Alice NULL 80
Bob Alice 90
Dan Alice 10
In the ReferralSales column, I want to display the aggregate sales of the associate through referrals.
Alice is responsible for referring Bob and Dan, resulting in 100 units of sales. Bob referred Alice, 50 units. Carl referred Bob, 60 units. Dan referred no one.
How can this be achieved? I have tried:
SUM({1 Associate = {ReferredBy}} SalesQty)

Assuming you are trying to do this in a bar chart or similar, make
ReferredByyour primary dimension and then usesum(SalesQty)as the expression. This will give you a bar chart that displays aggregate sales for each referrer which matches the breakout you mentioned. You wouldn't need set analysis at all for this.To learn more about set analysis check here. For example, you could use this to limit your output to just referrals to one Associate:
sum({$<Associate={'Bob'}>} SalesQty).