Page 1 of 1

Numeric Attributes and Rules

Posted: Mon Jan 12, 2009 4:56 pm
by Steve Vincent
I wanted to do a simple check on a dim i am rebuilding to count the number of parents each element had. I created a numeric attribute, wrote a rule and nothing happened. After much head scratching i used a string attribute with the same code (all be it using STR to convert result to a string) and it worked.

Confused, i created a dummy dim in the test server with a few string elements and a numeric attribute. The simple code below does not work, so why can i create numeric rules in a "normal" cube but not in an attributes one? When i have a simple requirement like ELPARN is it not a waste of resources to have to find the value then convert it to a string, rather than just use the number?

Code: Select all

['test'] = 999;

Re: Numeric Attributes and Rules

Posted: Mon Jan 12, 2009 5:04 pm
by Martin Ryan
I think all attributes get treated like strings as far as attributes are concerned. This will be related to a) the fact that numeric attributes don't consolidate up the hierarchy and b) (related), the data type for a numeric attribute is actually 'AN', rather than 'N'. You can verify that by using the 'dtype' macro in Excel.

An approach Steve R uses, which I've started using as well, is having a string element that calculates the attribute, then TIing it across to a numeric attribute whenever the dimension is updated.

Martin