Hi Guys,
I have requirement where i have to copy data from one element to multiple other elements within a dimension. I have customer dimension and version dimension. I have to load data from my source customer to multiple target customers, similarly from source version to multiple target versions.I have a maximum of 50 target customers and 10 target versions. I am loading the data with customer and version combination. I have built lookup cube with pick list in order to pass parameters dynamically into my TI process.
Below Find My TI Code:
Prolog:
pSourceCustomer = CellGetS('Control Cube','p01','Customer Name');
pSourceVersion = CellGetS('Control Cube','p01','Version Type');
pTargetCustomer = CellGetS('Control Cube','p02','Customer Name');
pTargetVersion = CellGetS('Control Cube','p02','Version Type');
here for each parameter i am referring my lookup cube , is there any better way to optimize the TI Code to pull all the 50 parameters into my TI Process.
DATA :
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutS(SValue,'General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutN(NValue,'General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
Suggest me if there is a better way to change the TI Code.
Regards,
Arvind.
Copy data from one element to another element in a single dimension
-
- Posts: 51
- Joined: Sun Sep 11, 2016 1:55 pm
- OLAP Product: Cognos Tm1
- Version: 10.2,11
- Excel Version: 2007
-
- Posts: 51
- Joined: Sun Sep 11, 2016 1:55 pm
- OLAP Product: Cognos Tm1
- Version: 10.2,11
- Excel Version: 2007
Re: Copy data from one element to another element in a single dimension
Guys,
In the above code which i have shared i am calling parameter every time from the lookup cube, i have a max of 50 Parameters, can we write a loop condition such that the parameter is dynamically passed in to the TI process from the lookup cube where user passes the parameters through pick-list.
Regards,
Arvind
In the above code which i have shared i am calling parameter every time from the lookup cube, i have a max of 50 Parameters, can we write a loop condition such that the parameter is dynamically passed in to the TI process from the lookup cube where user passes the parameters through pick-list.
Regards,
Arvind
-
- Community Contributor
- Posts: 165
- Joined: Tue Apr 02, 2013 1:41 pm
- OLAP Product: tm1, cognos bi
- Version: from TM1 9.4 to PA 2.0.9.6
- Excel Version: 2010
- Location: Toronto, ON
Re: Copy data from one element to another element in a single dimension
You Can use the EXPAND function
vDynamicVariableName = EXPAND( '%' | YOUR_EXPRESSION | '%' );
vDynamicVariableName = EXPAND( '%' | YOUR_EXPRESSION | '%' );
Ardian Alikaj
-
- Posts: 51
- Joined: Sun Sep 11, 2016 1:55 pm
- OLAP Product: Cognos Tm1
- Version: 10.2,11
- Excel Version: 2007
Re: Copy data from one element to another element in a single dimension
Thanks for the reply ardi, could you tell me in detail like how expand function works here in my case ?? Do i have to use any loop condition here?
-
- 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: Copy data from one element to another element in a single dimension
Hi Arvind,Please have a look at below link,It gives you good idea of expand function usage.
http://users.skynet.be/fa436118/wim/tm1 ... tII_EN.htm Thanks
http://users.skynet.be/fa436118/wim/tm1 ... tII_EN.htm Thanks
"You Never Fail Until You Stop Trying......"
-
- Posts: 51
- Joined: Sun Sep 11, 2016 1:55 pm
- OLAP Product: Cognos Tm1
- Version: 10.2,11
- Excel Version: 2007
Re: Copy data from one element to another element in a single dimension
Hi Abdul,
I have altered my code as below:
Code in DATA tab :
i= 1;
while (i <=10);
pDim = 'p_Parameters';
pDim1 = 'p_Parameters_Version';
Param1 = Dimnm('pDim', i);
Param2 = Dimnm('pDim1',i);
pSourceCustomer = CellGetS('Test Customer Control Cube','Param1','Source Customer');
pTargetCustomer = CellGetS('Test Customer Control Cube','Param1','Target Customer');
pSourceVersion = CellGetS('Test Version Control Cube','Param2','Source Version');
pTargetVersion = CellGetS('Test Version Control Cube','Param2','Target Version');
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutS(SValue,'Test_General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutN(NValue,'Test_General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
i =i+1;
end;
in the above code it is unable to get the element from DIMNM function.
Guys,Provide any corrections needed in the above code
I have altered my code as below:
Code in DATA tab :
i= 1;
while (i <=10);
pDim = 'p_Parameters';
pDim1 = 'p_Parameters_Version';
Param1 = Dimnm('pDim', i);
Param2 = Dimnm('pDim1',i);
pSourceCustomer = CellGetS('Test Customer Control Cube','Param1','Source Customer');
pTargetCustomer = CellGetS('Test Customer Control Cube','Param1','Target Customer');
pSourceVersion = CellGetS('Test Version Control Cube','Param2','Source Version');
pTargetVersion = CellGetS('Test Version Control Cube','Param2','Target Version');
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutS(SValue,'Test_General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutN(NValue,'Test_General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
i =i+1;
end;
in the above code it is unable to get the element from DIMNM function.
Guys,Provide any corrections needed in the above code
-
- Community Contributor
- Posts: 165
- Joined: Tue Apr 02, 2013 1:41 pm
- OLAP Product: tm1, cognos bi
- Version: from TM1 9.4 to PA 2.0.9.6
- Excel Version: 2010
- Location: Toronto, ON
Re: Copy data from one element to another element in a single dimension
I don't understand why you include your variable pDim and pDim1 in quotes.
From what i understand from your code, you have 2 dimensions, one called p_Parameters and the other one p_Parameters_Version and then in your while loop you are trying to get the first 10 elements for each??? when then use them as parameters???
Can you try this instead?
while (i <=10);
pDim = 'p_Parameters';
pDim1 = 'p_Parameters_Version';
Param1 = Dimnm(pDim, i);
Param2 = Dimnm(pDim1,i);
pSourceCustomer = CellGetS('Test Customer Control Cube',Param1,'Source Customer');
pTargetCustomer = CellGetS('Test Customer Control Cube',Param1,'Target Customer');
pSourceVersion = CellGetS('Test Version Control Cube',Param2,'Source Version');
pTargetVersion = CellGetS('Test Version Control Cube',Param2,'Target Version');
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutS(SValue,'Test_General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutN(NValue,'Test_General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
i =i+1;
end;
From what i understand from your code, you have 2 dimensions, one called p_Parameters and the other one p_Parameters_Version and then in your while loop you are trying to get the first 10 elements for each??? when then use them as parameters???
Can you try this instead?
while (i <=10);
pDim = 'p_Parameters';
pDim1 = 'p_Parameters_Version';
Param1 = Dimnm(pDim, i);
Param2 = Dimnm(pDim1,i);
pSourceCustomer = CellGetS('Test Customer Control Cube',Param1,'Source Customer');
pTargetCustomer = CellGetS('Test Customer Control Cube',Param1,'Target Customer');
pSourceVersion = CellGetS('Test Version Control Cube',Param2,'Source Version');
pTargetVersion = CellGetS('Test Version Control Cube',Param2,'Target Version');
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutS(SValue,'Test_General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
IF( V3 @= pSourceCustomer & V2 @= pSourceVersion );
CellPutN(NValue,'Test_General',V1,pTargetVersion,pTargetCustomer,V4);
ENDIF;
i =i+1;
end;
Ardian Alikaj
-
- Posts: 51
- Joined: Sun Sep 11, 2016 1:55 pm
- OLAP Product: Cognos Tm1
- Version: 10.2,11
- Excel Version: 2007
Re: Copy data from one element to another element in a single dimension
Thanks ardi
, now the process is working fine.
