Questions about DIMNM and ATTRS

Post Reply
EP_explorer
Regular Participant
Posts: 221
Joined: Sat Dec 04, 2010 2:35 pm
OLAP Product: PAL
Version: 2.0.9
Excel Version: 2016

Questions about DIMNM and ATTRS

Post by EP_explorer »

I'm a novice in TM1 so don't judge me severe for my question

I want to make such thing. Put in cube elements with names of dimension elements.
It means:
dimension measure1 measure2 etc.
January January 1
February February 2
March March 3

For exmaple cube consists from 2 dimensions - Month and measures (element measure1 is string, element measure2 is number(code of month) )
First of all I tried to write rule
['measure1'] = DIMNM('Month',(DIMIX('Month',!Month)));
but it shows error:
Syntax error on or before ('Month',DIMIX('Mon
missing colon

But almost the same thing works for
['measure2'] = DIMIX('Month',!Month);
and I can see in the Cube codes of months

Also I tried the next thing - put names of months in Attributes of Dimension and used ATTRS
['measure1' ] = ATTRS('Month', !Month, 'Code_Month');
and received almost the same error - something about colon

Funny but then I adds function LONG
['measure2' ] = LONG((ATTRS('Month', !Month, 'Code_Month')));
It shows longs of strings of months in the Cube

and ATTRN is working.
['measure2' ] = ATTRN('Month', !Month, 'Code_M');

So is it possible to tackle the problem using DIMNM or ATTRS or I can't use these functions such way?
May be I can use other functions?
ajain86
Community Contributor
Posts: 132
Joined: Thu Oct 15, 2009 7:45 pm
OLAP Product: TM1
Version: 9.4.1 9.5 9.5.1
Excel Version: 2003 2007

Re: Questions about DIMNM and ATTRS

Post by ajain86 »

When you write a rule for a string cell, you need to use "S:" right after the equal sign to signify that the rule will calculate a string value.

So, update this:
['measure1'] = S: DIMNM('Month',(DIMIX('Month',!Month)));
Ankur Jain
EP_explorer
Regular Participant
Posts: 221
Joined: Sat Dec 04, 2010 2:35 pm
OLAP Product: PAL
Version: 2.0.9
Excel Version: 2016

Re: Questions about DIMNM and ATTRS

Post by EP_explorer »

Thank you
Post Reply