Page 1 of 1

Strange STR() function problem

Posted: Wed Dec 24, 2008 3:25 pm
by Harvey
Hi all,

I feel like I'm going batty, but there seems to be an error with the STR function in TM1 9.4. Essentially, the STR function only returns a correct result if the value is 0.95 or greater. Otherwise, it returns empty strings.

I've attached an image displaying the problem. StrValue is calculated by the following rule:

FEEDSTRINGS;
SKIPCHECK;
['StrValue'] = S:
STR(['Value'], 15, 2);
FEEDERS;
['Value'] => ['StrValue'];

I also tested 9.1 SP3 with the same result. Has anyone else noticed this behaviour, or am I going crazy?

Cheers,
Harvey.

PS: I want to do this because I need to look up the Cumulative Normal Distribution in a table. This table has a dimension with the lookup values as element names ('0.01', '0.02', etc), so I need the string equivalent of the current value to reference the lookup table.

Re: Strange STR() function problem

Posted: Sat Dec 27, 2008 12:46 am
by paulsimon
Lazarus,

I tried this in 9.1.3 and it works fine.

['String']=S: STR(DB('Test',!Any,'Number'),15,2) ;

I think that your problem is the old chestnut that you cannot use [] notation on the right hand side of a String Rule. You must use DB() even if you are referring to the same cube.

Regards

Paul Simon