Page 1 of 1
Counting N Level Elements
Posted: Wed May 08, 2013 3:33 pm
by RSK
I appear to be having a dumb day today, I'm struggling to create a count of N level elements within a customer of Hierarchy each rolling up to their respective consolidations it hierarchy.
In affect my rule is creating a flag against level zero elements which works fine, the problem is I can't get it to feed and therefore the consolidations are Zero.
Code: Select all
['Total Availability'] =N: IF (ELLEV('BP_TAR_Customers',!BP_TAR_Customers) = 0,1,CONTINUE);
FEEDERS;
['Total Availability']=>['Total Availability']
I am I being stupid?
Re: Counting N Level Elements
Posted: Wed May 08, 2013 3:42 pm
by declanr
Code: Select all
['Total Availability']=>['Total Availability']
This is just trying to feed a cell from itself which is never going to work... unless the cell is already fed from elsewhere and then there is no point.
You could just set up a 2-d cube with a 1 in it somewhere and then feed a total consolidation in "BP_Tar_Customers" which would in turn feed all of its leaf level elements.
For something like this though it would probably make sense to have an attribute for the dimension and populate it via TI to avoid the rule overhead altogether, if you build the dimension from TI anyway you can make sure it is always up to date. If its not built by TI then you would of course need to run the new TI everytime a customer was added manually... or if it was just 1 customer go through and do it manually in the attribute.
Re: Counting N Level Elements
Posted: Wed May 08, 2013 4:25 pm
by tomok
Do you need to know the count along all the dimensions in the cube or just the customer dimension? If it is just the customer dimension I would create a 2-D cube with Customer and Measure dims. In the Measure dim I would have one element called Total Availability. Then the rule file for this 2-D cube would be:
No SKIPCHECK or FEEDERS. The cube will be small so not using SKIPCHECK won't really matter. If you need the count across multiple dimensions I would load a value of 1 to the Total Availability element in every leaf intersection of the original cube. Then no feeding is necessary. it should be pretty easy to write a TI process to populate every leaf intersection of Total Availaibilty.