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

Post Reply
User avatar
Elessar
Community Contributor
Posts: 331
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

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

Post 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.
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
User avatar
Elessar
Community Contributor
Posts: 331
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

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

Post 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.
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
User avatar
scrumthing
Posts: 81
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 11.x
Excel Version: MS365

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

Post by scrumthing »

Thanks for the info! :-) As always the documentation is not right. :-(
There is no OLAP database besides TM1!
User avatar
Elessar
Community Contributor
Posts: 331
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

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

Post 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
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 6th article - PAfE + VBA: Commit each cell without pressing “Commit” button.
User avatar
scrumthing
Posts: 81
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 11.x
Excel Version: MS365

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

Post by scrumthing »

Yes, I want that!
:-)
There is no OLAP database besides TM1!
User avatar
Steve Rowe
Site Admin
Posts: 2410
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

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

Post 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.
Technical Director
www.infocat.co.uk
Mark RMBC
Community Contributor
Posts: 292
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

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

Post 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!
User avatar
Steve Rowe
Site Admin
Posts: 2410
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

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

Post 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:
Technical Director
www.infocat.co.uk
lotsaram
MVP
Posts: 3651
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

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

Post 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
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

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

Post 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
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
scrumthing
Posts: 81
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 11.x
Excel Version: MS365

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

Post 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.
There is no OLAP database besides TM1!
Mark RMBC
Community Contributor
Posts: 292
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

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

Post by Mark RMBC »

I am more from the Treble Ctrl C, as I always think you need an extra one for luck! :)
Post Reply