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

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

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

Post by Elessar » Mon Jun 29, 2020 12:36 pm

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

User avatar
Elessar
Community Contributor
Posts: 194
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Location: Russia

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

Post by Elessar » Fri Jul 03, 2020 10:34 am

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

scrumthing
Posts: 27
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: too many

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

Post by scrumthing » Fri Jul 03, 2020 1:22 pm

Thanks for the info! :-) As always the documentation is not right. :-(
There is no OLAP database besides TM1!

User avatar
Elessar
Community Contributor
Posts: 194
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Location: Russia

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

Post by Elessar » Fri Jul 03, 2020 3:01 pm

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

scrumthing
Posts: 27
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: too many

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

Post by scrumthing » Fri Jul 03, 2020 8:44 pm

Yes, I want that!
:-)
There is no OLAP database besides TM1!

User avatar
Steve Rowe
Site Admin
Posts: 2051
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: 10.2.2., PAW
Excel Version: Nearly all of them

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

Post by Steve Rowe » Mon Jul 06, 2020 12:12 pm

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.

Mark RMBC
Community Contributor
Posts: 229
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 » Mon Jul 06, 2020 12:18 pm

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: 2051
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: 10.2.2., PAW
Excel Version: Nearly all of them

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

Post by Steve Rowe » Mon Jul 06, 2020 1:12 pm

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:

lotsaram
MVP
Posts: 3409
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 » Mon Jul 06, 2020 3:47 pm

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: 2460
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365 - latest
Location: Brussels, Belgium
Contact:

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

Post by Wim Gielis » Mon Jul 06, 2020 9:36 pm

lotsaram wrote:
Mon Jul 06, 2020 3:47 pm
I'm sure you mean double ctrl+c
I thought more along the lines of Ctrl-c c c
Best regards,

Wim Gielis

Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 112 TM1 articles and a lot of custom code
Newest blog article: Selecting elements in the Subset Editor quickly

scrumthing
Posts: 27
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: too many

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

Post by scrumthing » Tue Jul 07, 2020 6:26 am

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: 229
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 » Tue Jul 07, 2020 7:10 am

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

Post Reply