String attribute being ignored in Control Cube rule

Post Reply
ViRa
Regular Participant
Posts: 155
Joined: Tue May 14, 2013 1:53 pm
OLAP Product: Cognos BI, TM1
Version: 9.5.2 - 10.1.1
Excel Version: Excel 2003

String attribute being ignored in Control Cube rule

Post by ViRa »

Hi all,

I'm trying to display in a Picklist (Attribute) cell the appropriate number of days based on the month/Year combination.

To do this, I've a Days dimension and have created subsets - '31 Days' and '30 Days'. The cube contains - Year, Month, and Measures dimension (and Days which is a picklist is an element of Measure Dimension). Month dimension has few Text Attributes such as 'Season' and 'Month Code' text attributes.

In the }ElementAttributes_Measures control cube, I've written the rule to display either Subset '31 Days' or '30 Days' as per the text attribute.

Code: Select all

['Picklist', 'Days' ]  = S: If(ATTRS('Month', 'Jan', 'Season')@='Winter','subset:Days:31 Days', 'subset:Days:30 Days');
However when I recalculate the cube, all the months show the '31 Days' despite of the rule. Could somebody please assist me in identifying why the 'ATTRS' part of the rule is not being executed to identify the month?

Appreciate your time and help.
ATTRS.JPG
ATTRS.JPG (90.88 KiB) Viewed 4528 times
Thanks
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: String attribute being ignored in Control Cube rule

Post by tomok »

ViRa wrote:

Code: Select all

['Picklist', 'Days' ]  = S: If(ATTRS('Month', 'Jan', 'Season')@='Winter','subset:Days:31 Days', 'subset:Days:30 Days');
However when I recalculate the cube, all the months show the '31 Days' despite of the rule. Could somebody please assist me in identifying why the 'ATTRS' part of the rule is not being executed to identify the month?
Well, let's see. Could it be because you've hard-coded 'Jan' into your rule so now every month's picklist is populated based on whether or not January's season is Winter? Isn't that condition always going to be true so the subset being used is always going to be 31 days? Do you think maybe 'Jan' should be replaced with !Month?
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
ViRa
Regular Participant
Posts: 155
Joined: Tue May 14, 2013 1:53 pm
OLAP Product: Cognos BI, TM1
Version: 9.5.2 - 10.1.1
Excel Version: Excel 2003

Re: String attribute being ignored in Control Cube rule

Post by ViRa »

Hi Tom,

Thanks for your reply. I replaced the hard-coded month value 'Jan' to '!Month' but it is throwing error in the Rules Editor. Could you please assist me?
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: String attribute being ignored in Control Cube rule

Post by tomok »

That's because Month is not one of the dimensions in that cube. I missed that you were trying to put this rule on the }ElementAttributes_Measures cube. You need to come clean with the EXACT structure of your Measures dimension. Without that I can't help you. Based on what you've provided so far there is no way to accomplish what you want.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
ViRa
Regular Participant
Posts: 155
Joined: Tue May 14, 2013 1:53 pm
OLAP Product: Cognos BI, TM1
Version: 9.5.2 - 10.1.1
Excel Version: Excel 2003

Re: String attribute being ignored in Control Cube rule

Post by ViRa »

Hi Tom,

Yes I realized that since Month is not part of the }ElementAttributes_<measure dimension> control cube, the rule was not getting applied. I chose to write the rule in the }ElementAttributes_<measure dimension> control cube since the 'Picklist' element is available there.

I've attached the cube structure below. Is there a way I can write the rule in the master cube that would let me edit the Attribute list?
Thanks for your time and help.
Cube Structure.JPG
Cube Structure.JPG (89.94 KiB) Viewed 4492 times
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: String attribute being ignored in Control Cube rule

Post by tomok »

You need the Month context in order to have the picklist you want. Since doing it via an attribute of the Measure dimension cannot provide that context, your only option is to create a picklist cube on the TestDaysPicklist cube.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
ViRa
Regular Participant
Posts: 155
Joined: Tue May 14, 2013 1:53 pm
OLAP Product: Cognos BI, TM1
Version: 9.5.2 - 10.1.1
Excel Version: Excel 2003

Re: String attribute being ignored in Control Cube rule

Post by ViRa »

Thanks Tom for your guidance. Picklist cube did the task. Dont know how I missed seeing that option.
Thanks for your time.
Post Reply