ATTRS in rules

Post Reply
carsten
Posts: 17
Joined: Tue Jul 26, 2011 10:16 am
OLAP Product: TM1
Version: 10.2.2.3
Excel Version: 2013

ATTRS in rules

Post by carsten »

Hi I'm trying to build a rule from a e.g. 2 dimensional cube

Cube1:
Dimension 1
dimension 2 (This has an attribute = "dimension3attribute"

to a cube with 3 dimension

Cube2:
Dimension1
dimension2
dimension3

as followed

[] = N: DB('Cube1',!Dimension1,!Dimension2, attrs('Dimension3', !Dimension3, 'Dimension3Attribute');

But htis is not working ? Is this generally possible to build?

Thx
Carsten
declanr
MVP
Posts: 1828
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: ATTRS in rules

Post by declanr »

The DB statement is referencing CUBE 1 which has 2 dimensions but you have tried to put 3 qualifiers in it.


Since Cube 2 has the extra dimension you will need to put something on the left e.g.

['dim 3 element']=N: DB('Cube 1', !Dim 1, !Dim 2);


Since you seem to be wanting to do something where the attributes of Dimension 2 are the elements of Dimension 3, you will possibly need to build consolidations into Dimension 2 instead of (or in addition to) the attributes...

Can you provide more detail of exactly what you are trying to do?


Edit - with the consolidations you could then do:

[]=N: DB('Cube 1', !Dim1, !Dim3); .... since the elements of Dim 3 will be the consolidations in Dim2
Declan Rodger
carsten
Posts: 17
Joined: Tue Jul 26, 2011 10:16 am
OLAP Product: TM1
Version: 10.2.2.3
Excel Version: 2013

Re: ATTRS in rules

Post by carsten »

thx for answering

i want to make a 2 dimensional cube to a 3 dimensional cube. And the 3rd dimension is an attribute of Cube1 (or dimension2)
declanr
MVP
Posts: 1828
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: ATTRS in rules

Post by declanr »

I was meaning a bit more detail about the cubes/dimensions/elements... anyways...

Create a TI that cycles through dimension 2 and adds the N-Level elements under consolidated elements created from the N-Level element's attributes.

Then use the line in the rule of cube 2 that I posted above e.g. []=N: DB('Cube1', !Dim1, !Dim3);
Declan Rodger
rozef
Posts: 74
Joined: Thu Jun 17, 2010 10:35 am
OLAP Product: TM1
Version: 9.4 9.5.1
Excel Version: 2003 - 2007

Re: ATTRS in rules

Post by rozef »

I think what carsten expect is:

[] = N: IF( attrs('Dimension2', !Dimension2, 'Dimension3Attribute') @= !Dimension3,
DB('Cube1',!Dimension1,!Dimension2 ),
Continue );

Depending if your attribute is on dimension 2 or 3, you should maybe reverse the IF statement.
declanr
MVP
Posts: 1828
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: ATTRS in rules

Post by declanr »

rozef wrote:I think what carsten expect is:

[] = N: IF( attrs('Dimension2', !Dimension2, 'Dimension3Attribute') @= !Dimension3,
DB('Cube1',!Dimension1,!Dimension2 ),
Continue );

Depending if your attribute is on dimension 2 or 3, you should maybe reverse the IF statement.
Ah I see what it is that was wanted now.

But why would you do this, since the 3rd dimension is the attribute of the 2nd you will never have anything from dimension 2 appearing in more than one element from dimension 3?
Declan Rodger
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: ATTRS in rules

Post by tomok »

declanr wrote:But why would you do this, since the 3rd dimension is the attribute of the 2nd you will never have anything from dimension 2 appearing in more than one element from dimension 3?
From this particular rule, yes. Perhaps there will be other rules to populate other elements of dimension3 or maybe he will load data into those other elements.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
declanr
MVP
Posts: 1828
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: ATTRS in rules

Post by declanr »

tomok wrote:
declanr wrote:But why would you do this, since the 3rd dimension is the attribute of the 2nd you will never have anything from dimension 2 appearing in more than one element from dimension 3?
From this particular rule, yes. Perhaps there will be other rules to populate other elements of dimension3 or maybe he will load data into those other elements.
If that is the case then great but the []= suggests that it will be entirely populated from "Cube 1".

I should have worded my last post better but was trying to see if the OP understands the concepts of where it is most suitable to use attributes vs extra dimensionality.
Last edited by declanr on Fri Jul 13, 2012 1:31 pm, edited 1 time in total.
Declan Rodger
rozef
Posts: 74
Joined: Thu Jun 17, 2010 10:35 am
OLAP Product: TM1
Version: 9.4 9.5.1
Excel Version: 2003 - 2007

Re: ATTRS in rules

Post by rozef »

Maybe it was just an example. I already saw this kind of rules to retrieve operationnal data into different cnosolidation.
For exemple a duration indicator transposed into a time hierarchy.
carsten
Posts: 17
Joined: Tue Jul 26, 2011 10:16 am
OLAP Product: TM1
Version: 10.2.2.3
Excel Version: 2013

Re: ATTRS in rules

Post by carsten »

declanr wrote:
rozef wrote:I think what carsten expect is:

[] = N: IF( attrs('Dimension2', !Dimension2, 'Dimension3Attribute') @= !Dimension3,
DB('Cube1',!Dimension1,!Dimension2 ),
Continue );

Depending if your attribute is on dimension 2 or 3, you should maybe reverse the IF statement.
Ah I see what it is that was wanted now.

But why would you do this, since the 3rd dimension is the attribute of the 2nd you will never have anything from dimension 2 appearing in more than one element from dimension 3?
Thanks this is exactly what i needed. Its working fine.
Post Reply