Need help optimizing simple rule

Post Reply
Sighurd
Posts: 30
Joined: Mon Oct 03, 2011 9:18 pm
OLAP Product: TM1
Version: 10.2.2fp6
Excel Version: 2016

Need help optimizing simple rule

Post by Sighurd »

Here is a simplified version of the problem I stumbled upon in Cognos Express 10.1, Architect.

I have a detailed cube which contains different values about Product Lines. Product lines are grouped to Product Types. This cube is in upper-left corner of a screenshot.

screenshot

I need to get the data into other cube which contains same data for Product Types. It is on the lower left corner of the screenshot.

I tried 3 approaches to write a rule, and I don't really like the result. They are on the right side of the screenshot. Only first approach really works, but in my real task there are a lot of Product Types and they are constantly changing, so supporting this approach will require a LOT of maintenance. I would be happy if approach #3 worked, but it does not.

I think I oversee something really simple, and i hope someone will point it out for me.
User avatar
Michel Zijlema
Site Admin
Posts: 712
Joined: Wed May 14, 2008 5:22 am
OLAP Product: TM1, PALO
Version: both 2.5 and higher
Excel Version: 2003-2007-2010
Location: Netherlands
Contact:

Re: Need help optimizing simple rule

Post by Michel Zijlema »

Hi,

You could use your 3rd rule - with one change: you need to use the !t reference instead of the !t-l reference as the !t-l dimension is not included in the t-values cube.

Michel
Sighurd
Posts: 30
Joined: Mon Oct 03, 2011 9:18 pm
OLAP Product: TM1
Version: 10.2.2fp6
Excel Version: 2016

Re: Need help optimizing simple rule

Post by Sighurd »

It worked, thank you! :D

Now I need some time to actually understand why :shock:
tkingcka
Posts: 28
Joined: Fri Nov 13, 2009 12:02 pm
OLAP Product: IBM Cognos TM1
Version: 10.2.2
Excel Version: 2013

Re: Need help optimizing simple rule

Post by tkingcka »

Can you post a screen shot of the final rule with the recommended change? Thanks
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: Need help optimizing simple rule

Post by EvgenyT »

Sighurd wrote:It worked, thank you! :D

Now I need some time to actually understand why :shock:
As Michel said ...
you need to use the !t reference instead of the !t-l reference as the !t-l dimension is not included in the t-values cube.
In simple words !t-l dimension is not part of the t-values cube, hence you are getting an error...
Sighurd
Posts: 30
Joined: Mon Oct 03, 2011 9:18 pm
OLAP Product: TM1
Version: 10.2.2fp6
Excel Version: 2016

Re: Need help optimizing simple rule

Post by Sighurd »

The final rule is:

Code: Select all

[]=DB('t-l-values',!t,!values_dim);
I read what Michel said and I have no doubts whatsoever that he is right. The only reason I am confused is that I got the wrong expression

Code: Select all

[]=DB('t-l-values',!t-l,!values_dim);
using standard wizard in expression editor. I selected the source cube t-l-values and had to replace one of it's dimensions in wizard's output manually. It is a little counterintuitive, so I had to dwell on that. I think I understand it now :)
EvgenyT
Community Contributor
Posts: 324
Joined: Mon Jul 02, 2012 9:39 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: 2016
Location: Sydney, Australia

Re: Need help optimizing simple rule

Post by EvgenyT »

Hehe. Its a bit... when I first started writing rules I was puzzled too..

Simple rule: when referring other cubes in your rule ( DB('t-value..) etc ) you must use source dimension reference, even if the elements are the same in both dimension.

Does it make sense?

Thanks

ET
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: Need help optimizing simple rule

Post by tomok »

Here's a little bit more. When writing rules that use the !DimensionName syntax, the DimensionName parameter has to be a dimension that exists in the current cube. The rule syntax checker requires that. It doesn't mean that the actual dimension has to exist in the other cube for the rule to work. At run time, TM1 will use the elements in the existing cube to do a JOIN against the dimension in the source cube. The rule will work for any element names that match in the two dimensions, i.e., where the JOIN works. This is an EXTREMELY powerful feature and can be used to your advantage in many ways. I use it all the time.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Sighurd
Posts: 30
Joined: Mon Oct 03, 2011 9:18 pm
OLAP Product: TM1
Version: 10.2.2fp6
Excel Version: 2016

Re: Need help optimizing simple rule

Post by Sighurd »

Thank you, colleagues! Your input is very clear, precise and straight to the point. I am very glad I did post my question here!
I think I'll post another one :)
Post Reply