Getting error while loading string measure element
-
- Posts: 9
- Joined: Fri Mar 21, 2014 11:19 am
- OLAP Product: Cognos TM1,Cognos Reporting
- Version: 10.2
- Excel Version: 10.2
Getting error while loading string measure element
Hi All,
When i am trying to archive source cube data to target cube, i am facing error for only string measure element and for other elements, the data got loaded successfully.The error info is : Data Source line (2) Error: Data procedure line (0): Cannot convert field number 6, value "No Comments" to a real number.
In my TI Code, i am creating temporary view for source cube which acts as my data source by passing parameters and filtering the view(Bedrock Cubeview create process) .The issue is arising for only string measure elements.
Can any one suggest on the above issue.
When i am trying to archive source cube data to target cube, i am facing error for only string measure element and for other elements, the data got loaded successfully.The error info is : Data Source line (2) Error: Data procedure line (0): Cannot convert field number 6, value "No Comments" to a real number.
In my TI Code, i am creating temporary view for source cube which acts as my data source by passing parameters and filtering the view(Bedrock Cubeview create process) .The issue is arising for only string measure elements.
Can any one suggest on the above issue.
-
- Community Contributor
- Posts: 324
- Joined: Mon Jul 02, 2012 9:39 pm
- OLAP Product: TM1
- Version: PAL 2.0.8
- Excel Version: 2016
- Location: Sydney, Australia
Re: Getting error while loading string measure element
You are trying to load string to a numeric cell, hence the error.
Can you please provide the code
Evgeny
Can you please provide the code
Evgeny
- Michel Zijlema
- Site Admin
- Posts: 713
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: Getting error while loading string measure element
More specifically the issue is that you have the data variable in your variables tab set up as numeric, while the value you're receiving is string (in some cases). If the value can be either string or numeric it's better to setup the variable in TI as string and convert the value to numeric when you're loading a N-cell.EvgenyT wrote:You are trying to load string to a numeric cell, hence the error.
Michel
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Getting error while loading string measure element
As what Michel stated I have a few stock TIs that move all the data out of a cube or into a cube and set the variable as a string then just use:
The above assumes that v5 variable equates to the measures dimension.
Code: Select all
sMeasureType = DType ( sDimMeasures, v5 );
If ( sMeasureType @= 'S' );
CellPutS ( value, sCubDest, v1, v2, v3, v4, v5 );
ElseIf ( sMeasureType @= 'N' );
nValue = StringToNumber ( Value );
CellPutN ( nValue, sCubDest, v1, v2, v3, v4, v5 );
EndIf;
Declan Rodger
-
- Community Contributor
- Posts: 324
- Joined: Mon Jul 02, 2012 9:39 pm
- OLAP Product: TM1
- Version: PAL 2.0.8
- Excel Version: 2016
- Location: Sydney, Australia
Re: Getting error while loading string measure element
Thanks for elaborating further guys.
Since your datasource is a view you can also take advantage of Value_is_String function.
Like Rodger said, set variable to string and use this bit below
IF(VALUE_IS_STRING=1);
CELLPUTS(sValue, vCube,vElem,vElem2....)
ELSE;
CELLPUTN(nValue,vCube,vElem,vElem2....)
ENDIF;
Evgeny
Since your datasource is a view you can also take advantage of Value_is_String function.
Like Rodger said, set variable to string and use this bit below
IF(VALUE_IS_STRING=1);
CELLPUTS(sValue, vCube,vElem,vElem2....)
ELSE;
CELLPUTN(nValue,vCube,vElem,vElem2....)
ENDIF;
Evgeny
-
- Posts: 9
- Joined: Fri Mar 21, 2014 11:19 am
- OLAP Product: Cognos TM1,Cognos Reporting
- Version: 10.2
- Excel Version: 10.2
Re: Getting error while loading string measure element
Hi All,
Thanks for the replies.
I already declared as a string in variables tab. And my measure string element is of string type in both source and target dimensions.I am getting the same error.
Here i am using cellgets and cellputs functions for fetcing and loading respectively.
Thanks for the replies.
I already declared as a string in variables tab. And my measure string element is of string type in both source and target dimensions.I am getting the same error.
Here i am using cellgets and cellputs functions for fetcing and loading respectively.
- Michel Zijlema
- Site Admin
- Posts: 713
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: Getting error while loading string measure element
Could you please post a screenshot of your Variables tab?gandikota wrote:Hi All,
Thanks for the replies.
I already declared as a string in variables tab. And my measure string element is of string type in both source and target dimensions.I am getting the same error.
Here i am using cellgets and cellputs functions for fetcing and loading respectively.
Michel
-
- 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: Getting error while loading string measure element
You are aware, though, that it doesn't matter what data type you have the elements declared as unless they're in the last dimension in both cubes, right?gandikota wrote:I already declared as a string in variables tab. And my measure string element is of string type in both source and target dimensions.I am getting the same error.
Here i am using cellgets and cellputs functions for fetcing and loading respectively.
Because the only way you're getting the error that you described is if, in some way or another, you are trying to fit a round (string) peg into a square (numeric) hole.
It might be worth describing the dimensionality of the two cubes as well.
"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.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-
- Community Contributor
- Posts: 324
- Joined: Mon Jul 02, 2012 9:39 pm
- OLAP Product: TM1
- Version: PAL 2.0.8
- Excel Version: 2016
- Location: Sydney, Australia
Re: Getting error while loading string measure element
Given what Alan said about dimensionality and using examples myself and others provided you should not get an error. Is your last dimension a measure dimension with elements like value, string etc?
Thanks
Evgeny
Slightly off the topic here: using CellGets and CellPuts in this context will concatenate strings in the cell, is it what are you really after?Here i am using cellgets and cellputs functions for fetcing and loading respectively.
Thanks
Evgeny