AnsweredAssumed Answered

Average Rollup

Question asked by AlistairFrith on Nov 3, 2016
Latest reply on Nov 4, 2016 by dsouzarich

I am trying to do an 'Average' rollup of an attribute through several levels and am hitting a problem when there are no elements at the lowest level: the first rollup gives a value of zero and higher levels then use that value erroneously. I'll try to explain...


Normally, all units will be 100% available and I need to know the availability for the area (and further on up the hierarchy as well). Values less than 100% are of concern. Because Unit 2 has no children, its 'Average' rollup evaluates to 0 and this affects Area 1's rollup. I would like Area 1 to ignore Unit 2 entirely, or if I can't do that, then for Unit 2 to default to 100%. Items are based on an 'Item' template, units on a 'Unit' template and areas on an 'Area' template. I don't want to derive a different template for units that don't have children as I don't think that's what templates are really for.


I was thinking of creating an analysis on the Unit template that counts the number of children and uses the Rollup if there are children, and '100%' if there are none. But I can't see how to count the children!


Any suggestions?