Hi,
Am trying to modify a element level security TI process build by me. I gave user the flexibility to flag N level elements in a product dimension. (I created a mapping cube taking products Dim and a dummy measure to hold the flags). And wrote a TI process to read all these flags for N level products and putting security in }ElementsAttributes_Products cube to write or None
Issue:
By the above process am only able to get the flag values at N level products and say that
##A while loop runs through all products
IF(cellgetN,MappingCube, product,measure) = 1 );
Then i put None in seucity cube and
IF(CellGetN, MappingCube,prroduct,measure) = 0 );
Then i put Write in security cube
so on for all elements...
Now i want to put None if all the N level elements of a C level Parent in Product are flagged with 1's .
How to get a parent Name of whose all N level children are given values 1's
Identify Parent Name on child flags
- vinnusea
- Posts: 116
- Joined: Thu Sep 23, 2010 6:12 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2010
- Location: San Diego ,CA
Identify Parent Name on child flags
- Attachments
-
- Mapping Cube
- Mappingflags.JPG (10.78 KiB) Viewed 6333 times
Thanks
Vinnusea
Vinnusea
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: Identify Parent Name on child flags
You could iterate over the parents only and compare the value at the intersection (of the parent and 'Not Valid Flag') to the number of children in that parent (i.e. using ELCOMPN). Where the value equalled the number of children you have a parent that should have NONE for element security.vinnusea wrote:How to get a parent Name of whose all N level children are given values 1's
For this to work, you'd need to have standard element weightings in the SKU dimension (i.e. the default of 1). In the screenshot, the child SKUs don't appear to be consolidating... it actually looks like you have given them zero weight in the SKU dimension which strikes me as quite a strange thing to do... perhaps I have got it wrong?
Robin Mackenzie
-
- MVP
- Posts: 3706
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Identify Parent Name on child flags
If I have understood correctly you have used the attribute cube to hold the 1s for the security mapping. This explains why the values are not consolidating. If you use an ordinary cube instead then the values will roll up and Robin's suggestion will work. (for level 1 parents only though mind you, if you want the same logic to flow higher up you could use the same logic but would need an additional measure and a rule.)
Bear in mind though that with this security schema the user will see a the full value of any parent even if they can see only a limited number of children which could be confusing for users if they expect the parent values to equal the subtotal of the children they can see.
Bear in mind though that with this security schema the user will see a the full value of any parent even if they can see only a limited number of children which could be confusing for users if they expect the parent values to equal the subtotal of the children they can see.
- vinnusea
- Posts: 116
- Joined: Thu Sep 23, 2010 6:12 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2010
- Location: San Diego ,CA
Re: Identify Parent Name on child flags
Thank you Guys for the quick reply.
First of all i apploze to miss to provide some information. I have written a rule for this mapping cube saying [Not Valid Flag] = C:0; . That is the reason why its showing Zero's at C level. I have done this just to provide a clean N level flagging to Users. By that they enter flag 1 if N level element is Not Valid and hidden.
Yes, as per rmackenzie & lotsaram advice i have to remove this rule and see the C level rollup is equal to total number of child's then HIDE.
And lotsaram suggested if i need to iterate on more than 1 level of parent i need to put 1more measure and a rule which would be good idea but unfortunately i have very less time to wrap this up and rebuilding cube and dependent Active forms take some time so will try later if i was given some time to accomplish.
Thank you one and all for helping me out...
First of all i apploze to miss to provide some information. I have written a rule for this mapping cube saying [Not Valid Flag] = C:0; . That is the reason why its showing Zero's at C level. I have done this just to provide a clean N level flagging to Users. By that they enter flag 1 if N level element is Not Valid and hidden.
Yes, as per rmackenzie & lotsaram advice i have to remove this rule and see the C level rollup is equal to total number of child's then HIDE.
And lotsaram suggested if i need to iterate on more than 1 level of parent i need to put 1more measure and a rule which would be good idea but unfortunately i have very less time to wrap this up and rebuilding cube and dependent Active forms take some time so will try later if i was given some time to accomplish.
Thank you one and all for helping me out...
Thanks
Vinnusea
Vinnusea
- vinnusea
- Posts: 116
- Joined: Thu Sep 23, 2010 6:12 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2010
- Location: San Diego ,CA
Re: Identify Parent Name on child flags
An Update:
I removed the C:0 Rule and
I tried a lot but as you already said , am only able to find a direct parent and hide it. I cannot go more than 1 parent.
The logic i used is like
Is there any work around to take all the parents to hide with out changing the cube structure by adding 1 more Dim??
I removed the C:0 Rule and
I tried a lot but as you already said , am only able to find a direct parent and hide it. I cannot go more than 1 parent.
The logic i used is like
Code: Select all
##A lot of code apart from what is shown below
#Newline
parentsize = ELCOMPN(SKUDim,SkuNM);
IF(ParentSize >0);
parentflag = CellGetN( SKUControl, SkuNM, RegionFromGroup,'Not Valid Flag');
IF(parentflag = parentsize);
sAccessParent = NONE;
CELLPUTS( sAccess, SKUSecurityCube, SkuNM, GroupNM);
Endif;
Endif;
- Attachments
-
- G.JPG (8.76 KiB) Viewed 6270 times
Thanks
Vinnusea
Vinnusea
-
- MVP
- Posts: 733
- Joined: Wed May 14, 2008 11:06 pm
Re: Identify Parent Name on child flags
This should work, but it is going to fall over if you have multiple hierarchies in the SKU dimension... for which extra logic will be necessary.am only able to find a direct parent and hide it. I cannot go more than 1 parent.
Code: Select all
##A lot of code apart from what is shown below
#Newline
parentsize = ELCOMPN(SKUDim,SkuNM);
IF(ParentSize >0);
parentflag = CellGetN( SKUControl, SkuNM, RegionFromGroup,'Not Valid Flag');
IF(parentflag = parentsize);
sAccessParent = NONE;
CELLPUTS( sAccess, SKUSecurityCube, SkuNM, GroupNM);
#---------- iterate through parents and put NONE in there as well
nContinue=1;
sElemName=SkuNM;
WHILE(nContinue<>0);
# note only using first parent...
sParent=ELPAR(SkuDIM,sElemname,1);
IF(sParent@<>'');
CELLPUTS( sAccess, SKUSecurityCube, sParent, GroupNM);
sElemName=sParent;
ELSE;
nContinue=0;
ENDIF;
END;
#--------------------------------------------------------------------------
Endif;
Endif;
Robin Mackenzie
- vinnusea
- Posts: 116
- Joined: Thu Sep 23, 2010 6:12 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2010
- Location: San Diego ,CA
Re: Identify Parent Name on child flags
Thanks rmackenzie, will work with your logic. Thank you for you time. Appreciate that.
Thanks
Vinnusea
Vinnusea