Page 1 of 1

STR(Num, len, dec) with only one argument

Posted: Mon Jun 29, 2020 12:36 pm
by Elessar
Hello,

The documentation says (in short):
Arguments:
  • Number - the number to convert
  • Length - ... If the length parameter is not specified, the number parameter is preserved and the length of the function result includes sign, separators, decimal, and decimal places. ...
  • Decimal - ... If this parameter is 0 or not specified, a decimal point is not included. ...
Has anyone tried to "not specify" this arguments?
I try to leave the Length and Decimal arguments (just use "STR(8008135)") in both Rule and TI process, and get an error both in Architect and PAW.

Re: STR(Num, len, dec) with only one argument

Posted: Fri Jul 03, 2020 10:34 am
by Elessar
Answer from IBM:
IBM wrote:All parameters to STR are required. You cannot omit any parameters or pass empty parameter values.
The documentation will be updated shortly with this clarification.

Re: STR(Num, len, dec) with only one argument

Posted: Fri Jul 03, 2020 1:22 pm
by scrumthing
Thanks for the info! :-) As always the documentation is not right. :-(

Re: STR(Num, len, dec) with only one argument

Posted: Fri Jul 03, 2020 3:01 pm
by Elessar
I don't think this is really a documentation mistake. The information about those "not specified" parameters appeared in PA (comparing to TM1 10.2.2 doc), and supposedly with 2.0.5 version ("The behavior of the STR function has been updated. This may cause a behavior change in usage depending on which version of IBM Planning Analytics you are upgrading from"). So I think they tried to implement this NumberToString analogue, but "something gone wrong".

BTW, does anybody (like me) want NumberToString in rules? If so, I'll create RFE for this

Re: STR(Num, len, dec) with only one argument

Posted: Fri Jul 03, 2020 8:44 pm
by scrumthing
Yes, I want that!
:-)

Re: STR(Num, len, dec) with only one argument

Posted: Mon Jul 06, 2020 12:12 pm
by Steve Rowe
Whilst you are making the RFE could you suggest they change the function name to something a bit longer as I don't have enough typing to do?

Maybe
ConvertTheNumberValueInBracketsFromANumberToAStringPleaseOhGoOnNowDoUsAFavourGuv( Numeric );

Seriously, there is not too much wrong with the str function IMO except that NumberToString exists at all and I keep using it in rules and getting stuck trying to figure out why my rules won't compile. Would vote for the RFE just to stop me getting stuck on that.

Re: STR(Num, len, dec) with only one argument

Posted: Mon Jul 06, 2020 12:18 pm
by Mark RMBC
Whilst you are making the RFE could you suggest they change the function name to something a bit longer as I don't have enough typing to do?
lol! I have always wanted some function aliases in TM1 but was too afraid to ask! So NumberToString could be NTS for example.

That would have saved soooo much time with asciioutputs and debugging! Though ctrl c and v helps!

Re: STR(Num, len, dec) with only one argument

Posted: Mon Jul 06, 2020 1:12 pm
by Steve Rowe
Yeah, I suggested function alias once to Ronnie at a face to face somewhere, he thought it was an excellent idea...funnily enough while I was whinging about NumberToString.

It should be simple to implement as well, just right click on the Function dimension and create the alias. If only we had access to the objects the next level down in the database. :lol:

Re: STR(Num, len, dec) with only one argument

Posted: Mon Jul 06, 2020 3:47 pm
by lotsaram
Steve Rowe wrote: Mon Jul 06, 2020 1:12 pm It should be simple to implement as well, just right click on the Function dimension and create the alias. If only we had access to the objects the next level down in the database. :lol:
FWIW you can use CellGetS and CellGetN in place of DB in rules ...
Mark RMBC wrote: Mon Jul 06, 2020 12:18 pm lol! I have always wanted some function aliases in TM1 but was too afraid to ask! So NumberToString could be NTS for example.

That would have saved soooo much time with asciioutputs and debugging! Though ctrl c and v helps!
I'm sure you mean double ctrl+c

Re: STR(Num, len, dec) with only one argument

Posted: Mon Jul 06, 2020 9:36 pm
by Wim Gielis
lotsaram wrote: Mon Jul 06, 2020 3:47 pmI'm sure you mean double ctrl+c
I thought more along the lines of Ctrl-c c c

Re: STR(Num, len, dec) with only one argument

Posted: Tue Jul 07, 2020 6:26 am
by scrumthing
lotsaram wrote: Mon Jul 06, 2020 3:47 pm FWIW you can use CellGetS and CellGetN in place of DB in rules ...
At first I thought: 'how cool is that. I didn't know that.' Than it settled in. DB( is way shorter and I do not need to differentiate between S and N at that point in rules if I know my data model. :-(

But still... It is nice to know and it confirms that most of the tm1 core developers at IBM do not really know what they are doing.

Re: STR(Num, len, dec) with only one argument

Posted: Tue Jul 07, 2020 7:10 am
by Mark RMBC
I am more from the Treble Ctrl C, as I always think you need an extra one for luck! :)