There is a variable number of type=1 per Global_ID. Each T=1 can have a number of T=2, which again holds a couple of T=3. Variables nT1 to nT3 is what I want to achieve in order to pivot all data (total number and average of type=2 and 3 per Label). When I aggregate now per Aggr(Sum(if([Type]=2,1,0)),[Ref]) these values are not written into the line with the label. Any idea how to do this "cross aggregation"? (Didn't find a better caption)