Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I read elsewhere on this forum that if you put some set analysis in the outermost part of Aggr(), it will affect everything inside of it. But that doesn't seem to be fully true.
I have this set analysis that ignores all selections except for some date fields:
Set v_DF = {1<Year = $::Year, Quarter = $::Quarter, Month = $::Month>};
This works correctly as far as I can tell, though maybe there's some corner case I haven't noticed yet:
Set vd_partCumRevenue% =
Aggr($(v_DF) NODISTINCT
Rangesum(Above(Sum(Revenue), 0, RowNo())) / Sum(TOTAL Revenue),
(Part, (=Sum($(v_DF) Revenue), Desc))
);
Meanwhile, this version definitely does not work (it recalculates based on selections other than those 3 date fields):
Set vd_partCumRevenue% =
Aggr($(v_DF) NODISTINCT
Rangesum(Above(Sum(Revenue), 0, RowNo())) / Sum(TOTAL Revenue),
(Part, (=Sum(Revenue), Desc))
);
At this point, out of paranoia, I'm wondering whether to sprinkle that set analysis variable in there in some more places. Does anyone have a clear idea of what the rules are regarding this? Is there some documentation spelling it out clearly?