Cell type is real

Post Reply
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Cell type is real

Post by BariAbdul »

I am trying to do some basic data load of CurrentVersion and PreviousVersion data. My source is cube view.My Code in Prolog is:

Code: Select all

vCube='CPractive';
Dim='AVersion';
LoadVersion='201302';
Data tab:
[code
#****Begin: Generated Statements***
#****End: Generated Statements****
pCurrentVersion = Numbr(subst(LoadVersion, 2, 3));
pPrevVersion = pCurrentVersion - 1;

IF (pPrevVersion < 12);
mPrevVersion = '_0'|str(pPrevVersion,3,0);
Else;
mPrevVersion = '_'|str(pPrevVersion,4,0);

EndIF;
IF
( CellIsUpdateable('CPractive','Cost Centre7','LoadVersion','value')=1);

CELLPUTN(pCurrentVersion,'CPractive','Cost Centre7','LoadVersion','value');
ENDIF;
CellPutS(mPrevVersion, 'CPractive', 'Cost Centre7', 'PreviousVersion', 'value');
][/code]
The Process is saving fine but it is giving me an error “Cell Type is Real”. I understand that the message (http://www.tm1forum.com/viewtopic.php?f ... 9&start=60)and played around by changing the element type as string but keep getting the same error :? , Could someone please tell me I could I resolve it.Thanks in advance.
"You Never Fail Until You Stop Trying......"
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Cell type is real

Post by BariAbdul »

The variable tab is:
Attachments
Variable tab.docx
(24.08 KiB) Downloaded 455 times
"You Never Fail Until You Stop Trying......"
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Cell type is real

Post by lotsaram »

"Cell type is real" is just TM1 telling you that you cant write text data to a numeric leaf cell.

Look at your 2 cell put statements.

Code: Select all

IF( CellIsUpdateable('CPractive','Cost Centre7','LoadVersion','value')=1);
  CELLPUTN(pCurrentVersion,'CPractive','Cost Centre7','LoadVersion','value');
ENDIF;
CellPutS(mPrevVersion, 'CPractive', 'Cost Centre7', 'PreviousVersion', 'value');
I would assume that 'LoadVersion' and 'PreviousVersion' would be of the same element type, no? In which case no surprise that there is an error.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Cell type is real

Post by BariAbdul »

Thanks a lot Lotsaram.The loadVersion is numeric data type where as PreviousVersion is of String data type.
"You Never Fail Until You Stop Trying......"
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Cell type is real

Post by lotsaram »

BariAbdul wrote:Thanks a lot Lotsaram.The loadVersion is numeric data type where as PreviousVersion is of String data type.
In which case your error is that variable pCurrentVersion is of type string but you are attempting to use it in a CellPutN to a numeric cell.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Cell type is real

Post by BariAbdul »

Thanks for your valuable time,Strangely when I changed the data type of CurrentVersion and PreviousVersion to string the process ran successfully But there are no values in the cube ,It just displaying zeros,Any clues ,Please.
"You Never Fail Until You Stop Trying......"
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: Cell type is real

Post by Steve Rowe »

It is possible this CellIsUpdateable('CPractive','Cost Centre7','LoadVersion','value')=1); test is causing your TI to fail silently, comment it out to see whats really happening.
Technical Director
www.infocat.co.uk
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: Cell type is real

Post by rmackenzie »

Steve Rowe wrote:It is possible this CellIsUpdateable('CPractive','Cost Centre7','LoadVersion','value')=1); test is causing your TI to fail silently, comment it out to see whats really happening.
It's a good option given that there's a known bug (various TM1 versions) such that if an IF statement contains a CellGetN or S, CellIsUpdateable or AttrS and the function errors then the error doesn't properly 'bubble up' into the IF statement and the execution isn't stopped. Search the forum for extra reports on this.

The way to code around this is to declare a variable with the result of the test prior to the IF statement, i.e.:

Code: Select all

# put the test in a separate statement in case of error in the function
nTest = CellIsUpdateable('CPractive','Cost Centre7','LoadVersion','value');
# IF statement is now simplified from debugging point of view
IF ( nTest = 1 );
    CELLPUTN(pCurrentVersion,'CPractive','Cost Centre7','LoadVersion','value');
ENDIF;
CellPutS(mPrevVersion, 'CPractive', 'Cost Centre7', 'PreviousVersion', 'value');
Some people might regard this as 'tidier' coding, even though it adds extra statements.
Robin Mackenzie
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: Cell type is real

Post by Steve Rowe »

I wasn't really referring to a bug in the CellIsUpdateable more that if there is a fundamental issue with what the OP is trying to do, i.e. variables the wrong way round or the cellput would in fact *KeyError then the CellIsUpdateable would be masking these issues.

Not really a fan of using this command as a matter of course as it hides errors that you probably need to know about...
Technical Director
www.infocat.co.uk
Tilo
Posts: 50
Joined: Mon Oct 06, 2008 4:27 pm
Location: Hamburg

Re: Cell type is real

Post by Tilo »

I have checked the threads referring to the error "cell type is real".

My Problem is that I have a check for the cell type and still get the error.

I copy data within a cube - string and numeric values.
A cube view is used as source.
Consolidated, calculated and zero value cells are excluded.

The source variables are all defined as string in the variables tab.
So the variable "Value" is defined as string.

IF (DType('vDim_last_dim_in_Cube',vDim_last_dim_in_Cube) @= 'N');
CellPutN(StringToNumber(Value), vCube, vDim1, vDim2, vDim3, ..., vDim_last_dim_in_Cube);
ELSE;
CellPutS(Value, vCube, vDim1, vDim2, vDim3, ..., vDim_last_dim_in_Cube);
ENDIF;

The error is thrown for the data tab for the code line "CellPutS(Value, vCube, vDim1, vDim2, vDim3, ..., vDim_last_dim_in_Cube);"

What could be the cause for the error?

Thanks
Tilo
BariAbdul
Regular Participant
Posts: 424
Joined: Sat Mar 10, 2012 1:03 pm
OLAP Product: IBM TM1, Planning Analytics, P
Version: PAW 2.0.8
Excel Version: 2019

Re: Cell type is real

Post by BariAbdul »

I copy data within a cube - string and numeric values.
If you copying mixed data,Please look at the below post:
http://www.tm1forum.com/viewtopic.php?f=3&t=1109&p=6155 Thanks
"You Never Fail Until You Stop Trying......"
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Cell type is real

Post by lotsaram »

Tilo wrote: IF (DType('vDim_last_dim_in_Cube',vDim_last_dim_in_Cube) @= 'N');
CellPutN(StringToNumber(Value), vCube, vDim1, vDim2, vDim3, ..., vDim_last_dim_in_Cube);
ELSE;
CellPutS(Value, vCube, vDim1, vDim2, vDim3, ..., vDim_last_dim_in_Cube);
ENDIF;

The error is thrown for the data tab for the code line "CellPutS(Value, vCube, vDim1, vDim2, vDim3, ..., vDim_last_dim_in_Cube);"

What could be the cause for the error?
The cause of the error is that you are trying to do a CellPutS into a numeric leaf cell. That much seems obvious from the error message.

However seem as the code is attempting to deal with this and branch into CellPutN and CellPutS a better question is why this is happening. I suspect that what you think is the last dimension of the cube is not really the effective last dimension due to the cube being reordered. To make the code more generic and "future proof" you could instead use the 3 implicit variables at your disposal when using a cube view as the data source; value_is_string, nValue & sValue

E.g.

Code: Select all

IF( value_is_string = 1 );
               CellPutN( nValue, vCube, vDim1, vDim2, vDim3, ..., vDim_last_dim_in_Cube );
ELSE;
               CellPutS( sValue, vCube, vDim1, vDim2, vDim3, ..., vDim_last_dim_in_Cube );
ENDIF;
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Tilo
Posts: 50
Joined: Mon Oct 06, 2008 4:27 pm
Location: Hamburg

Re: Cell type is real

Post by Tilo »

I actually meant ""Why do I get THIS error, though I "made sure" that I cannot get it"".
If I do not trust why should I not also consider that an error message could be misleading.
I have seen this in my life.
I should have mentioned that I checked the Cube order before with "reorder dimensions" in the Server Explorer and that we use TM1 10.2.2 FP3.
Is that enough proof?
Would a Loop using TabDim make sure to get the correct order - I guess so.

Here in this case:
DTYPE seems to be a problem - but not every TI execution (while always using the same test data situation) failed.
Working with VALUE_IS_STRING, SVALUE and NVALUE worked so far.
If the error comes up again despite using the variables I will post it.

Thanks for the help.
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Cell type is real

Post by lotsaram »

Agree with you that error messages can sometimes be funky but that one seems unambiguous. If value_is_string is working without error then it would indicate that strings aren't being passed anymore to CellPutN
Tilo wrote:Would a Loop using TabDim make sure to get the correct order - I guess so.
I don't think so, I'm pretty sure TabDim will return the dimension names per the original index order of the cube. Just like DBRW and CellPutN always take the original dimension order.

I had assumed that you provided pseudo code. But if your code is actually verbatim copy/paste then it could explain your error.
IF (DType('vDim_last_dim_in_Cube',vDim_last_dim_in_Cube) @= 'N');
I assume there isn't actually a dimension called vDim_last_dim_in_Cube? If DType is passed in a 1st argument that isn't an actual dimension name I'm not sure what it would return but definitely not N, S or C.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Tilo
Posts: 50
Joined: Mon Oct 06, 2008 4:27 pm
Location: Hamburg

Re: Cell type is real

Post by Tilo »

Yes, it was pseudo code - regarding the Dimension Names.
But the Dimension and the variable containing the dimension elements have the same name and that is what I wanted to be reflected.
Who knows if this could not have been a Problem, too...
I do TM1 Support for Consulting customers and inhouse for several years and have opened 60 tickets for TM1 during the last two years only and have seen weird behaviour so often...
(let us not talk about the support...)
a)
My first thought was, that maybe in TM1 10.2.2 FP3 there is a different behaviour when importing N-Element-data into a variable that is defined with the string datatype.
This guy here describes something that leads into this direction:
http://dw.developer-works.com/article/1 ... om+process
b)
Thanks for the explanantion of the referred Dimension order with TabDim/DBRW/CellPutN.

I thought about a possible reason for the behaviour related to a) and b) as all bedrock processes use TabDim to get the Dimension order.
Post Reply