Page 1 of 1

String attribute being ignored in Control Cube rule

Posted: Thu Apr 16, 2015 5:01 pm
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 4525 times
Thanks

Re: String attribute being ignored in Control Cube rule

Posted: Thu Apr 16, 2015 5:34 pm
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?

Re: String attribute being ignored in Control Cube rule

Posted: Thu Apr 16, 2015 6:26 pm
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?

Re: String attribute being ignored in Control Cube rule

Posted: Thu Apr 16, 2015 7:27 pm
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.

Re: String attribute being ignored in Control Cube rule

Posted: Thu Apr 16, 2015 8:01 pm
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 4489 times

Re: String attribute being ignored in Control Cube rule

Posted: Thu Apr 16, 2015 9:29 pm
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.

Re: String attribute being ignored in Control Cube rule

Posted: Thu Apr 16, 2015 11:04 pm
by ViRa
Thanks Tom for your guidance. Picklist cube did the task. Dont know how I missed seeing that option.
Thanks for your time.