Help on rule

Post Reply
Stuart74
Posts: 5
Joined: Fri Sep 20, 2013 9:17 am
OLAP Product: Cognos Planning - TM1
Version: 10.1.1 - 10.1.1
Excel Version: Various to 2010

Help on rule

Post by Stuart74 »

Hello

I am an experienced Cognos Planning developer new to TM1. So maybe this is welcome to enlightenment or the darkside :D

I am attempting to write a rule in a cube so that a picklist is defined by what is chosen in another picklist, a cascasing picklist. Unfortunately I seem to be going round in circle with errors from the editor. My rule is posted below. Any advice would be greatfully received.

Code: Select all

['Fleet Assumptions':'Business Sub Type']= S: if (DB('Fleet Dimensions', !Elist, !Version, ATTRS('Fleet Assumptions','Business Type') @='Selection1','Static:Test1:Test2'));
The editor complains of unexpected parenthesis.

Where Business Sub Type is the cascaded picklist and Business Type is the "master". So I want Business Sub Type to show Test1, Test 2 if Business Type is Selection1.

For info there are two business types and 5 sub types so I dont think I need to use a dynamic table of values, or a design of this sort.

Thank you

Stuart
User avatar
Michel Zijlema
Site Admin
Posts: 713
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: Help on rule

Post by Michel Zijlema »

Stuart74 wrote:

Code: Select all

['Fleet Assumptions':'Business Sub Type']= S: if (DB('Fleet Dimensions', !Elist, !Version, ATTRS('Fleet Assumptions','Business Type') @='Selection1','Static:Test1:Test2'));
There is a number of things in this rule that are not OK:
1. the colon in the area definition (should be a comma?)
2. the ATTRS function should have 3 arguments, not 2
3. there's no ending parenthesis for the DB function
4. there's a double ending parenthesis for the if statement.

Michel
Stuart74
Posts: 5
Joined: Fri Sep 20, 2013 9:17 am
OLAP Product: Cognos Planning - TM1
Version: 10.1.1 - 10.1.1
Excel Version: Various to 2010

Re: Help on rule

Post by Stuart74 »

Thank you for your quick respone. Ill have a look and advise.

Regards

Stuart
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Help on rule

Post by Duncan P »

Michel. I think that the left hand side is OK. The 'Fleet Assumptions' is merely fully qualifying the 'Business Sub Type' element with its dimension name. This is good syntax.

However Stuart, the other issue is that your IF only appears to provide a value for the true case. IF takes three arguments, condition, true_result and false_result. You need a value for the case where your DB returns something other than 'Selection1'.
User avatar
Michel Zijlema
Site Admin
Posts: 713
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: Help on rule

Post by Michel Zijlema »

Duncan P wrote:Michel. I think that the left hand side is OK. The 'Fleet Assumptions' is merely fully qualifying the 'Business Sub Type' element with its dimension name. This is good syntax.
You're right - I completely forgot about that.
Stuart74
Posts: 5
Joined: Fri Sep 20, 2013 9:17 am
OLAP Product: Cognos Planning - TM1
Version: 10.1.1 - 10.1.1
Excel Version: Various to 2010

Re: Help on rule

Post by Stuart74 »

Hello

Thank you for your help.

I have now made changes in line with your suggestions and the rule saves without error. However, it does not seem to work as nothing is returned. (I have tried to simplifiy to get to work, hence no Static word)

Code: Select all

['Fleet Assumptions':'Business Sub Type']=S:if(DB('Fleet Dimensions', !Elists, !Version, ATTRS('Business Type',!Fleet Assumptions,'Caption_Default'))@='Selection1','1','0',)
Is there anything I am doing wrong?

Thanks

Stuart
declanr
MVP
Posts: 1831
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: Help on rule

Post by declanr »

Stuart74 wrote:Hello

Thank you for your help.

I have now made changes in line with your suggestions and the rule saves without error. However, it does not seem to work as nothing is returned. (I have tried to simplifiy to get to work, hence no Static word)

Code: Select all

['Fleet Assumptions':'Business Sub Type']=S:if(DB('Fleet Dimensions', !Elists, !Version, ATTRS('Business Type',!Fleet Assumptions,'Caption_Default'))@='Selection1','1','0',)
Is there anything I am doing wrong?

Thanks

Stuart
Do you have any rules before this that apply to the same cells?

Right-click on one of the cells in question and select "trace calculation" (if the cell is just white however try tracing on one of its consolidations and drilling down)... that should tell you what rules are applying etc.
Declan Rodger
lotsaram
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: Help on rule

Post by lotsaram »

Stuart74 wrote:Is there anything I am doing wrong?
Hard to say, and I don't think anyone can do better than guess unless you post the full dimensionality of both the Picklist cube and the Fleet Dimensions cube. Only then can we say for sure.
Stuart74
Posts: 5
Joined: Fri Sep 20, 2013 9:17 am
OLAP Product: Cognos Planning - TM1
Version: 10.1.1 - 10.1.1
Excel Version: Various to 2010

Re: Help on rule

Post by Stuart74 »

Hello

Heres the extra information; I hope is is enough, let me know if more is required.

There is no picklist cube.

Fleet Dimensions cube has 3 dimensions; name (dimension type).

Elists (Hierarchy)
Version (Versions)
Fleet Assumptions (Generic)

On the Fleet Assumptions there are the elements

Business Type
Business Sub Type

Business Type is formatted with a picklist which uses another dimension called Business Type which has two elements, Selection1 and Selection 2.

Busienss Sub Type does not have any formatting.

Amongst others. I have confirmed that there are no feeders, links, or calculations other than the one I am writing in this forum thread on the Item Business Sub Type.

Thanks

Stuart
lotsaram
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: Help on rule

Post by lotsaram »

Stuart74 wrote:There is no picklist cube.
Then where on earth are you writing this rule !?! :?
You can only have a picklist, and therefore a rule for a picklist against either an attribute called "Picklist" or in a Picklist cube. So given from the left hand side of your rule it clearly is not for the picklist element in an ElementAttributes cube then if there is no picklist cube then it sounds like you have led us on a merry wild goose chase ...
java_to_tm1
Posts: 33
Joined: Mon Sep 23, 2013 3:24 pm
OLAP Product: TM1
Version: 10.2
Excel Version: Excel 2010

Re: Help on rule

Post by java_to_tm1 »

Staurt,
Picklists in Cognos TM1
picklists need to go into 1 of 2 places..
1. You can create picklists with element attributes, these go into the control cube '}ElementAttributes_dimname'.
2. You can create Picklists using a picklist cube: if you need greater control on the picklist (specifyin different picklists for different sections of the cube)

In your case, you should probably start off by creating the picklist cube and then writing rules in the picklist cube to show up custom picklists for 'Business Sub Type' depending on 'Business Type' selection

lotsaram, think I missed something in there?

~Sri
The Java_to_TM1 Convert
TM1 Version 10.1, 10.2, Cognos Insight 10.1, 10.2
Local: Windows 7 Professional, Excel 2007
Server: Windows Server 2008 64-bit
p.s. I have a healthy disregard for Performance Muddler.
java_to_tm1
Posts: 33
Joined: Mon Sep 23, 2013 3:24 pm
OLAP Product: TM1
Version: 10.2
Excel Version: Excel 2010

Re: Help on rule

Post by java_to_tm1 »

It is very tempting to try to write the text that defines the picklist as a rule-calculated value of the cell itself 'static:Test1:Test2', but TM1 will just show that up as a String. It will not treat that as a picklist at all.

Why doesnt TM1 allow you to set the picklist directly in the cube itself instead of forcing you to create/use a control cube?
The cells of the cube should contain DATA: The metadata (picklist, format, etc.) should be in control objects.

~Sri
The Java_to_TM1 Convert
TM1 Version 10.1, 10.2, Cognos Insight 10.1, 10.2
Local: Windows 7 Professional, Excel 2007
Server: Windows Server 2008 64-bit
p.s. I have a healthy disregard for Performance Muddler.
Stuart74
Posts: 5
Joined: Fri Sep 20, 2013 9:17 am
OLAP Product: Cognos Planning - TM1
Version: 10.1.1 - 10.1.1
Excel Version: Various to 2010

Re: Help on rule

Post by Stuart74 »

Thank you for your responses. Gives me alot to think about.

I had originally looked at

http://www.tm1forum.com/viewtopic.php?f=3&t=6078

But guess I have lost my way some what after.

Thank you

Stuart
Post Reply