Invalid Real Number Issues

Post Reply
normanbobo
Posts: 50
Joined: Tue Jun 15, 2010 3:14 pm
OLAP Product: TM1, PowerPlay, MSAS
Version: TM1 9.4.x 9.5.x 10.1
Excel Version: 2003 2007 2010

Invalid Real Number Issues

Post by normanbobo »

All,

A piece of code that has been working for months is all of a sudden broken and I can't isolate what change occurred to break it. Here is the code:

Code: Select all


nbrTotalPutCommitments = CELLGETN(strCubeNm, strEmplOrgSectionAllElem, strProjOrgSectionAllElem, strTaskOrgSectionAllElem, strActvCtrAllElem,
       strProjTaskAllElem, strFWkAllElem, strAgmtAllElem, strExpTypeAllElem, strProjTypeAllElem, strDeptSoftshellAllElem, strDivSoftshellAllElem,
       strCenterSoftshellAllElem,  strSBUSoftshellAllElem, strTIProcessElement, strActualsElement, strCommitmentElement);
nbrTotalPutRecordCount = CELLGETN(strCubeNm, strEmplOrgSectionAllElem, strProjOrgSectionAllElem, strTaskOrgSectionAllElem, strActvCtrAllElem,
       strProjTaskAllElem, strFWkAllElem, strAgmtAllElem, strExpTypeAllElem, strProjTypeAllElem, strDeptSoftshellAllElem, strDivSoftshellAllElem,
       strCenterSoftshellAllElem,  strSBUSoftshellAllElem, strTIProcessElement, strActualsElement, strTxnCntElement);

TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrTotalPutCommitments' , NUMBERTOSTRING(nbrTotalPutCommitments));
TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrTotalPutRecordCount' , NUMBERTOSTRING(nbrTotalPutRecordCount));

The TEXTOUTPUT commands return an error: "Invalid Real Number". It's almost like there is a string value or some other data corruption in the cube.

I used TEXTOUTPUT commands to display the values of the cube name and the dimension elements prior to the CELLGETN statement and all of them are correct. When I open the cube viewer, the cube returns normal, non-zero numeric values in the cells being read. Just to make sure nothing weird had happened to the cube somehow, I deleted and re-created the cube. Still the same issue. There are no string elements in any of the dimensions in the cube -- they are all simple/N. Any thoughts/ideas on how to hunt down this issue?
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Invalid Real Number Issues

Post by tomok »

Have you tried using the rules function, STR, to convert the numeric value to a string, instead of NUMBERTOSTRING, to see if that works?
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
jstrygner
MVP
Posts: 195
Joined: Wed Jul 22, 2009 10:35 pm
OLAP Product: TM1
Version: 9.5.2 FP3
Excel Version: 2010

Re: Invalid Real Number Issues

Post by jstrygner »

1. If you put:

Code: Select all

nbrTotalPutCommitments = nbrTotalPutCommitments + 1;
before TEXTOUTPUT will this line return error (try to figure out if the variable is not numeric or the NUMBERTOSTRING itself has problems).

2. Is the value with decimal separator? Any chance some settings with decimal separator changed anywhere?
User avatar
Steve Rowe
Site Admin
Posts: 2464
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: Invalid Real Number Issues

Post by Steve Rowe »

It might be a false error message and it's actually complaining about the file path and name? Have you tested that to see if it's valid and the user the TM1 instance is running under still has access to this location?
HTH
Technical Director
www.infocat.co.uk
normanbobo
Posts: 50
Joined: Tue Jun 15, 2010 3:14 pm
OLAP Product: TM1, PowerPlay, MSAS
Version: TM1 9.4.x 9.5.x 10.1
Excel Version: 2003 2007 2010

Re: Invalid Real Number Issues

Post by normanbobo »

thanks for the ideas....

The NUMBERTOSTRING function does not require that you take a guess at the size of the number and has been working for many such statements and, in fact, is working in other processes right now. But just to see if it would help uncover the root of the issue, I changed the code to use the STR function:

Code: Select all

TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrTotalPutCommitments' , STR(nbrTotalPutCommitments,20,2));
TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrTotalPutRecordCount' , STR(nbrTotalPutRecordCount,20,2));
The statements executed withot error, but returned the following lines in the output file (clearly not numbers):

"Epilog: nbrTotalPutCommitments","...................."
"Epilog: nbrTotalPutRecordCount","...................."

I then added statements to increment the values by 1:

Code: Select all

nbrTotalPutCommitments = CELLGETN(strCubeNm, strEmplOrgSectionAllElem, strProjOrgSectionAllElem, strTaskOrgSectionAllElem, strActvCtrAllElem,
       strProjTaskAllElem, strFWkAllElem, strAgmtAllElem, strExpTypeAllElem, strProjTypeAllElem, strDeptSoftshellAllElem, strDivSoftshellAllElem,
       strCenterSoftshellAllElem,  strSBUSoftshellAllElem, strTIProcessElement, strActualsElement, strCommitmentElement);
nbrTotalPutRecordCount = CELLGETN(strCubeNm, strEmplOrgSectionAllElem, strProjOrgSectionAllElem, strTaskOrgSectionAllElem, strActvCtrAllElem,
       strProjTaskAllElem, strFWkAllElem, strAgmtAllElem, strExpTypeAllElem, strProjTypeAllElem, strDeptSoftshellAllElem, strDivSoftshellAllElem,
       strCenterSoftshellAllElem,  strSBUSoftshellAllElem, strTIProcessElement, strActualsElement, strTxnCntElement);

nbrTotalPutCommitments = nbrTotalPutCommitments +1;
nbrTotalPutRecordCount = nbrTotalPutRecordCount +1;

TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrTotalInputCommitments' , STR(nbrTotalInputCommitments,20,2));
TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrTotalPutCommitments' , STR(nbrTotalPutCommitments,20,2));

TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrInputRecordCount ' , STR(nbrInputRecordCount,20,2));
TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrTotalPutRecordCount' , STR(nbrTotalPutRecordCount,20,2));
The statements executed without errors and returned the same results in the output file.

Hmmmm.....very strange ....
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Invalid Real Number Issues

Post by Alan Kirk »

normanbobo wrote:thanks for the ideas....

The NUMBERTOSTRING function does not require that you take a guess at the size of the number and has been working for many such statements and, in fact, is working in other processes right now. But just to see if it would help uncover the root of the issue, I changed the code to use the STR function:

Code: Select all

TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrTotalPutCommitments' , STR(nbrTotalPutCommitments,20,2));
TEXTOUTPUT(strTextOutputFileName, 'Epilog: nbrTotalPutRecordCount' , STR(nbrTotalPutRecordCount,20,2));
The statements executed withot error, but returned the following lines in the output file (clearly not numbers):

"Epilog: nbrTotalPutCommitments","...................."
"Epilog: nbrTotalPutRecordCount","...................."
You have three different versions in your profile; what's the exact version that you're using?

In 9.5.1 (no hot fixes applied and I have to get around to putting 9.5.2 on that machine), if I have a value which has more significant figures than TM1 can store then Str(dbl, 20,2) is giving me an empty string. Of course that may be something else in a different version of 9.5x. The value isn't throwing an error when I use NumberToString() though it's truncating back to 123456789012345 (followed by all 0's). Again this may be different in another version.

You said that the number is non-zero, but is it possible that the number in the cell is huge and that it could be triggering an error in the version that you're on?
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
User avatar
Martin Ryan
Site Admin
Posts: 2003
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Invalid Real Number Issues

Post by Martin Ryan »

Before numbertostring came around I used trim(str(myNumber, 100, 2)). This may help in your case.

Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
normanbobo
Posts: 50
Joined: Tue Jun 15, 2010 3:14 pm
OLAP Product: TM1, PowerPlay, MSAS
Version: TM1 9.4.x 9.5.x 10.1
Excel Version: 2003 2007 2010

Re: Invalid Real Number Issues

Post by normanbobo »

[quote="Alan Kirk]
You said that the number is non-zero, but is it possible that the number in the cell is huge and that it could be triggering an error in the version that you're on?
[/quote]

Alan, the number is large -- in the hundreds of millions -- not "huge".

This is quite the stumper....
normanbobo
Posts: 50
Joined: Tue Jun 15, 2010 3:14 pm
OLAP Product: TM1, PowerPlay, MSAS
Version: TM1 9.4.x 9.5.x 10.1
Excel Version: 2003 2007 2010

Re: Invalid Real Number Issues

Post by normanbobo »

All ... an update to this issue.

After initially reporting this as a bug, IBM development has now responded with a different answer, which actually makes a lot of sense.

We recently added BatchUpdate in the TI processes. If you have ever used BatchUpdate, you know that the BatchUpdateFinish (or BatchUpdateFinishWait) command must be in the Epilog and can only be the last statement in the Epilog. Without thinking about the interactions involved, the batch update commands were added to our TI processes in an effort to implement concurrency during our batch loads (using the new TM1RUNTI.exe command line to execute simultaneous loads). Well, one of the commands that the processes have long had in them were CELLGETN commands to read the total amounts posted to the cubes during the TI processes. These control totals were then saved to a control totals cube (which we intend to use in an automated process to verify our loads against external control totals). The problem was, though, the data in the cube had not been committed. Rather than returning an intelligible error message, the CELLGETN commands returned an internal "not committed" error message value -- as the value! This value then, caused all of the number to string conversion commands to fail. None of them would work. This all makes sense now. BTW, the value shows up when you turn on debugging.

The solution to this puzzle is to write a separate TI process to obtain the control totals.

What is interesting is that this process sometimes worked and the CELLGETN commands returned accurate values, even though the data had not been technically committed yet because the batchupdatefinish command had not yet been executed. The error started appearing when we began using TM1RUNTI.exe. We demonstrated this interaction in a series of controlled tests. So there is some connection to using TM1RUNTI.exe, but what that connection is will probably not ever be known.

Simple Lesson Learned: When using Batch Update commands, don't attempt to read a value out of a cube that was updated in the TI process. Seems kind of silly in hindsight now, but I am sure someone else will run across it.
Alan Kirk
Site Admin
Posts: 6667
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Invalid Real Number Issues

Post by Alan Kirk »

normanbobo wrote:All ... an update to this issue.

After initially reporting this as a bug, IBM development has now responded with a different answer, which actually makes a lot of sense.

We recently added BatchUpdate in the TI processes.
Soooo... not so much a case of "A piece of code that has been working for months is all of a sudden broken", more "We changed the code and now it's broken". A somewhat relevant piece of information seems to have been omitted from the original question. However it's good that you posted the resolution; it might save someone else some grief.

It's probably safe to assume that this Technote was published in response to that service request:
https://www-304.ibm.com/support/docview ... wg21512708
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
normanbobo
Posts: 50
Joined: Tue Jun 15, 2010 3:14 pm
OLAP Product: TM1, PowerPlay, MSAS
Version: TM1 9.4.x 9.5.x 10.1
Excel Version: 2003 2007 2010

Re: Invalid Real Number Issues

Post by normanbobo »

Alan Kirk wrote:
Soooo... not so much a case of "A piece of code that has been working for months is all of a sudden broken", more "We changed the code and now it's broken". A somewhat relevant piece of information seems to have been omitted from the original question.
It did work for many weeks with the batch update in it. That is what's so weird about this. It was when we started using TM1RUNTI.exe that the problem cropped up. So, no adding the batch update did not immediately break it, but now we see how that contributed to the problem and how we now need to remove the CELLGETN commands out to another process.
Post Reply