In Data of TI process often we have a constraction:
if (VALUE_IS_STRING=1);
CellPutS(SVALUE,Cube,dim1,dim2,dim3);
else;
CellPutN(NVALUE, Cube,dim1,dim2,dim3);
endif;
I want to ask a question - Is it possible to find out that dimensions elements correspond to current svalue or nvalue.
I want to use this feature to tackle next problem - I need to CellPutS(N) only from one slice of Cube - not from all Cube. For example Cube contains dim3 - Versions and I want to take data only element 'Version 1' from dimension 'Versions' and if Versions = any other version didn't CellPutS or CellPutN.
I tried to solve the problem by another methods:
http://forums.olapforums.com/viewtopic.php?f=3&t=4247
but It seems I make something wrong.
TI and local variables in Data
-
- Regular Participant
- Posts: 221
- Joined: Sat Dec 04, 2010 2:35 pm
- OLAP Product: PAL
- Version: 2.0.9
- Excel Version: 2016
-
- 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: TI and local variables in Data
I don't understand your question. In the following statement:
CellPutS(SVALUE,Cube,dim1,dim2,dim3);
CellPutS is a function in TM1 that sends a string value to a cube. SVALUE is a variable that holds the actual string data you are sending to the cube, Cube is a variable that represents the name of the cube, dim1 is a variable that represents the name of an element in the first dimension, dim2 is a variable that represents the name of an element in the second dimension, and dim3 is a variable that represents the name of an element in the thirds dimension. You have to provide actual values for all these variables at run time. They can either come from the data source, as columns, derived from a combination of column data and lookups or substrings, or hard-coded in the TI process. So, to answer your question "Is it possible to find out that dimensions elements correspond to current svalue or nvalue" the answer is YOU have to provide it yourself, either in the data source for the TI process, or a lookup, or hard-coded. TM1 can't tell you what these values are, TM1 is relying on you telling it what the values are.
CellPutS(SVALUE,Cube,dim1,dim2,dim3);
CellPutS is a function in TM1 that sends a string value to a cube. SVALUE is a variable that holds the actual string data you are sending to the cube, Cube is a variable that represents the name of the cube, dim1 is a variable that represents the name of an element in the first dimension, dim2 is a variable that represents the name of an element in the second dimension, and dim3 is a variable that represents the name of an element in the thirds dimension. You have to provide actual values for all these variables at run time. They can either come from the data source, as columns, derived from a combination of column data and lookups or substrings, or hard-coded in the TI process. So, to answer your question "Is it possible to find out that dimensions elements correspond to current svalue or nvalue" the answer is YOU have to provide it yourself, either in the data source for the TI process, or a lookup, or hard-coded. TM1 can't tell you what these values are, TM1 is relying on you telling it what the values are.
Then the answer is to create a subset in the dim3 dimension that only includes 'Version 1', build a view off that, and use that as your data source for the TI process. No filtering in the TI process will be necessary because you're only going to have 'Version 1' in the data to begin with.EP_explorer wrote:I want to use this feature to tackle next problem - I need to CellPutS(N) only from one slice of Cube - not from all Cube. For example Cube contains dim3 - Versions and I want to take data only element 'Version 1' from dimension 'Versions' and if Versions = any other version didn't CellPutS or CellPutN.
-
- Regular Participant
- Posts: 221
- Joined: Sat Dec 04, 2010 2:35 pm
- OLAP Product: PAL
- Version: 2.0.9
- Excel Version: 2016
Re: TI and local variables in Data
Yes I did view - in my previous topic
And now I filtered in Data using simple
in Prolog
Vers=CellGetS('PickVersion','Znachenie','Vers_Znach');
In Data
if(Versions@=vers);
m=CellIsUpdateable('1_input',Items,Numbers,V3);
if(m=1);
if (VALUE_IS_STRING=1);
CellPutS(SVALUE,'1_input',Items,Numbers,V3);
else;
CellPutN(NVALUE, '1_input',Items,Numbers,V3);
endif;
endif;
endif;
But result is the same - Windows error for TM1S
And now I filtered in Data using simple
in Prolog
Vers=CellGetS('PickVersion','Znachenie','Vers_Znach');
In Data
if(Versions@=vers);
m=CellIsUpdateable('1_input',Items,Numbers,V3);
if(m=1);
if (VALUE_IS_STRING=1);
CellPutS(SVALUE,'1_input',Items,Numbers,V3);
else;
CellPutN(NVALUE, '1_input',Items,Numbers,V3);
endif;
endif;
endif;
But result is the same - Windows error for TM1S
- Steve Vincent
- Site Admin
- Posts: 1054
- Joined: Mon May 12, 2008 8:33 am
- OLAP Product: TM1
- Version: 10.2.2 FP1
- Excel Version: 2010
- Location: UK
Re: TI and local variables in Data
is your datasource a cube view?
If this were a dictatorship, it would be a heck of a lot easier, just so long as I'm the dictator.
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet
Production: Planning Analytics 64 bit 2.0.5, Windows 2016 Server. Excel 2016, IE11 for t'internet