Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mmarchese
Creator II
Creator II

Set analysis propagation in Aggr()?

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?

Labels (3)
0 Replies