Page 1 of 1
TI and local variables in Data
Posted: Mon Feb 21, 2011 6:32 pm
by EP_explorer
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.
Re: TI and local variables in Data
Posted: Mon Feb 21, 2011 7:08 pm
by tomok
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.
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.
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.
Re: TI and local variables in Data
Posted: Tue Feb 22, 2011 9:12 am
by EP_explorer
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
Re: TI and local variables in Data
Posted: Wed Feb 23, 2011 3:15 pm
by Steve Vincent
is your datasource a cube view?