TM1 Rules Scenario Using Attributes

Post Reply
wigglyrat
Posts: 67
Joined: Wed Sep 02, 2015 3:09 pm
OLAP Product: TM1
Version: 10_2_2
Excel Version: 2010

TM1 Rules Scenario Using Attributes

Post by wigglyrat »

Hi - I have a requirement to rebuild a cube 'Commercial' with one additional dimension.

This cube 'Commercial' is currently using rules with DB functions to pull data into it from another cube 'zz Accident Year'.

In the 'Commercial' cube, one dimension ('zz BDE') held virtually identical data (just structured in a different hierarchy) to the ''zz Broker' dimension in the 'zz Accident Year' cube, so I used attributes to look up and match 'Agency no' between the two, as the example below shows, as agency numbers were the same between both.

Code: Select all

['zz Underwriting Year':'Unanalysed','Net Earned Premium','zz Tenure':'Unspecified']=N:DB('zz Accident Year','Actual',!zz Heads of Damage,!zz Accident Period,!zz Class,attrs('zz BDE',!zz BDE,'Agency No'),!zz Policy Event Type,'All Cover Types',!zz Development Month,!zz Measures);
Now the requirement is to add that dimension to the 'Commercial' cube which also exists in 'zz Accident Year', 'zz Broker'

This would ordinarily I suppose negate the need for using attributes to look up the data between 'zz BDE' dimension and 'zz Broker' dimension. But, I need to keep the 'zz BDE' dimension in the 'Commercial' cube as well, so I still need to use this attribute, I think.

How do I then tell TM1 that I want 'zz Broker' in the 'Commercial' cube to equal 'zz Broker' in the 'zz Accident Year' cube in the rule above while also keeping the attribute lookup?

Many thanks in advance for your advice.
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: TM1 Rules Scenario Using Attributes

Post by tomok »

You really should provide the complete dimensionality of all the cubes involved. Trying to discern what you are trying to do, based on your disjointed post, made my head hurt.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
wigglyrat
Posts: 67
Joined: Wed Sep 02, 2015 3:09 pm
OLAP Product: TM1
Version: 10_2_2
Excel Version: 2010

Re: TM1 Rules Scenario Using Attributes

Post by wigglyrat »

Apoligies.

The cube dimensions are as follows:

Commercial:
zz BDE (this uses attributes to look up agency no elements in zz Broker dimension below)
zz Broker (this is the new dimension that I need to adjust the rule to bring in)
zz Class
zz Development Month
zz Underwriting Year
zz Accident Period
zz Policy Event Type
zz Version
zz Heads of Damage
zz Tenure
zz Measures

zz Accident Year
zz Version
zz Heads of Damage
zz Accident Period
zz Class
zz Broker
zz Policy Event Type
zz Cover
zz Development Month
zz Measures


Many thanks again.
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: TM1 Rules Scenario Using Attributes

Post by declanr »

If I follow correctly then something like below should point you in the right direction.

Code: Select all

['zz Underwriting Year':'Unanalysed','Net Earned Premium','zz Tenure':'Unspecified']=N:
If ( attrs('zz BDE',!zz BDE,'Agency No') @= !zz Broker,
	 DB('zz Accident Year','Actual',!zz Heads of Damage,!zz Accident Period,!zz Class, !zz Broker,!zz Policy Event Type,'All Cover Types',
	 !zz Development Month,!zz Measures),
	 0
);
Declan Rodger
wigglyrat
Posts: 67
Joined: Wed Sep 02, 2015 3:09 pm
OLAP Product: TM1
Version: 10_2_2
Excel Version: 2010

Re: TM1 Rules Scenario Using Attributes

Post by wigglyrat »

Hi and thank you for the code.

I am not sure if I follow this.

The code above produces "Syntax error on or before: !zz Broker, DB(' incorrect logical comparison"

error.

Also I am not sure about using a conditional formula for this?

I would like it to pull data across to both "zz Broker" (using !zz Broker as this dimension exists in both) and "zz BDE" (using the attribute look-ups as it does now in the old rule), so doing both.

The users want to use both dimensions even though they are nearly the same.

Sorry if I am being confusing and thank you again for your help.
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: TM1 Rules Scenario Using Attributes

Post by declanr »

wigglyrat wrote: Also I am not sure about using a conditional formula for this?

I would like it to pull data across to both "zz Broker" (using !zz Broker as this dimension exists in both) and "zz BDE" (using the attribute look-ups as it does now in the old rule), so doing both.
That is what the if statement does. The rule without it would pull the value in to the correct zz broker element for EVERY element in your other dimension.
With the if statement it will only try and populate the intersection where the element in your other dimension has an attribute that matchs the zz broker element.

As to the syntax error it can be difficult to tell only with the code on the forum but to start with the basics did you put the code exactly as shown or did you replace @= with just an = symbol?

Also syntax could suggest I have missed a comma or bracket etc somewhere; it should be easy for you to check that stuff though.
Declan Rodger
babytiger
Posts: 78
Joined: Wed Jul 31, 2013 4:32 am
OLAP Product: Cognos TM1, EP, Analyst
Version: 10.2.2
Excel Version: 2013
Location: Sydney AU

Re: TM1 Rules Scenario Using Attributes

Post by babytiger »

If all leaf elements in 'zz BDE' and 'zz Broker' are identical (as you've suggested), you can substitute declanr's rule with:

Code: Select all

['zz Underwriting Year':'Unanalysed','Net Earned Premium','zz Tenure':'Unspecified']=N:
IF ( !zz BDE@=!zz Broker,
    DB('zz Accident Year','Actual',!zz Heads of Damage,!zz Accident Period,!zz Class, !zz Broker,!zz Policy Event Type,'All Cover Types',
    !zz Development Month,!zz Measures),
    0
);
MK
wigglyrat
Posts: 67
Joined: Wed Sep 02, 2015 3:09 pm
OLAP Product: TM1
Version: 10_2_2
Excel Version: 2010

Re: TM1 Rules Scenario Using Attributes

Post by wigglyrat »

It became evident that it was far simpler to do this via a TI instead of the rule so this is now working. Thanks to everyone for the assistance. :D
Post Reply