NUMBR conversion

Post Reply
Mark RMBC
Community Contributor
Posts: 296
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

NUMBR conversion

Post by Mark RMBC »

Hi all,

I have a TI process that does a while loop over a periods dimension. The dimension has in it elements that represent the period number, so 01,02,03…12. There are also a few other elements, called Annual Total, Adjustment.

When I ran the TI process there was an error saying, “Cannot convert string "Adjustment" to a real number”, which didn’t surprise me as the TI included a Numbr conversion against the elements in the periods dimension so it obviously can’t convert the word Adjustment to a number.

The puzzling thing is it doesn't throw up the same error for Annual Total. Any ideas why?
User avatar
gtonkin
MVP
Posts: 1254
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: NUMBR conversion

Post by gtonkin »

Any aliases on the dimension-if so what are they defined as and what values do they have for Annual Total?
What value is returned after the NUMBR function on Annual Total?
Edit: Looks like Annual Total is a red herring - other strings seems to return a value of zero - Tested with Aardvark, Banana and Zoo-Seems like it does not like "Adjusted" or "Adjustment" - Adjust is fine and so is Adjusts.
Happy fiddling on this one!
BR, George.

Learn something new: MDX Views
Mark RMBC
Community Contributor
Posts: 296
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

Re: NUMBR conversion

Post by Mark RMBC »

Hi gtonkin,

Yeah I had already looked at the attributes and there were no differences that made me think that was the issue.

I took your approach and tested on some words and had the following results:

Apple - Couldn't convert
Adjustment - Couldn't convert
Annual - Could Convert
Annual Total - Could Convert
Basement - Couldn't convert
Adventure - Couldn't convert

I will put this down as a mystery I won't bother thinking about ever again, except I will ensure any Numbr conversion coding excludes words just to be on the safe side!

Additional: I guess I should add when I Asciioutput the results there is 0 for every element in the dimension

cheers, Mark
Wim Gielis
MVP
Posts: 3222
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: NUMBR conversion

Post by Wim Gielis »

Hello Mark,

See: http://www.wimgielis.com/tm1_numbersandstrings_EN.htm

NUMBR
- Arguments:
A string

- Input: you must use . (period) as the decimal separator and , (comma) as the thousands separator
- Output: All characters other than '0' through '9', '+', '-', ',', '.' and 'E' are ignored.

So E (and also e) are not ignored, but TM1 cannot resolve it to a valid number, hence the error message.
It's used in scientific notation.

Your list of words that can or cannot be converted, respects this rule.
Best regards,

Wim Gielis

IBM Champion 2024-2025
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
Mark RMBC
Community Contributor
Posts: 296
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

Re: NUMBR conversion

Post by Mark RMBC »

Wim,

That totally explains it! Thanks a lot.

I was starting to think it was some sort of reserved word issue but then I thought Aardvark can't be a reserved can it!

How you managed to work that out is now the mystery!

Incidentally - soccer and TM1, a man after my own heart! Though I would call it football!

cheers, Mark
User avatar
gtonkin
MVP
Posts: 1254
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: NUMBR conversion

Post by gtonkin »

Thanks too Wim-guess the elements that failed have a pattern they all contain the letter "E" which it probably tries to convert from scientific notation.
BR, George.

Learn something new: MDX Views
Wim Gielis
MVP
Posts: 3222
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: NUMBR conversion

Post by Wim Gielis »

You're welcome. I looked at the string and applied Numbr to a word that became shorter and shorter, character after character, until only the "e" remained. Then I looked at my own page and the penny dropped :-)
Best regards,

Wim Gielis

IBM Champion 2024-2025
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
Post Reply