Numeric Attributes and Rules

Post Reply
User avatar
Steve Vincent
Site Admin
Posts: 1054
Joined: Mon May 12, 2008 8:33 am
OLAP Product: TM1
Version: 10.2.2 FP1
Excel Version: 2010
Location: UK

Numeric Attributes and Rules

Post 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;
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
User avatar
Martin Ryan
Site Admin
Posts: 1988
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Numeric Attributes and Rules

Post 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
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Post Reply