Page 1 of 1

Questions about DIMNM and ATTRS

Posted: Tue Dec 14, 2010 7:13 pm
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?

Re: Questions about DIMNM and ATTRS

Posted: Tue Dec 14, 2010 7:28 pm
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)));

Re: Questions about DIMNM and ATTRS

Posted: Wed Dec 15, 2010 6:44 pm
by EP_explorer
Thank you