Load data from dynamic CubeView
-
- Posts: 4
- Joined: Thu Jan 08, 2015 1:27 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2007
Load data from dynamic CubeView
Hello together,
I try to copy data from a dynamic CubeView.
Prolog:
##################
# definition of source
##################
DatasourceNameForServer = p_Cube;
DataSourceType = 'View';
DatasourceCubeview = V_Name;
- variables p_Cube, p_View, v_Name are parameters
- The source cube is equal to the target cube.
- Only one element within one special dimension (called 'PV') is different for the copy part
- Within the source cube (=target cube) it is unknown how much dimensions are included
- Within the source cube (=target cube) it is unknown at which position/index I can find the special dimension named 'PV' (it is sure that this dimension is within the cube).
Those information should be known for the CellPutN(); that is used within the data tab of the Turbo Integrator.
Lets imagine p_Cube has 4 dimensions and on index number 2 is the special dimension 'PV' and the element ist called 'PV1'... then it should be like:
CellPutN(Value,p_Cube,V1,'PV1',V3,V4);
I tried to get the answer with something like this:
v_counter = 1;
While ( TABDIM(Cube, v_counter) @<> '' );
sDim = TabDim(Cube, v_counter);
IF(v_counter = 1);
v_Dim_at_DimIndex1 = sDim;
ElseIF(v_counter = 2);
v_Dim_at_DimIndex2 = sDim;
ElseIF(v_counter = 3);
v_Dim_at_DimIndex3 = sDim;
.
.
.
But it didn't work!
Now the question:
Is there a way to solve this problem?
Thank you for your help!!!!!
I try to copy data from a dynamic CubeView.
Prolog:
##################
# definition of source
##################
DatasourceNameForServer = p_Cube;
DataSourceType = 'View';
DatasourceCubeview = V_Name;
- variables p_Cube, p_View, v_Name are parameters
- The source cube is equal to the target cube.
- Only one element within one special dimension (called 'PV') is different for the copy part
- Within the source cube (=target cube) it is unknown how much dimensions are included
- Within the source cube (=target cube) it is unknown at which position/index I can find the special dimension named 'PV' (it is sure that this dimension is within the cube).
Those information should be known for the CellPutN(); that is used within the data tab of the Turbo Integrator.
Lets imagine p_Cube has 4 dimensions and on index number 2 is the special dimension 'PV' and the element ist called 'PV1'... then it should be like:
CellPutN(Value,p_Cube,V1,'PV1',V3,V4);
I tried to get the answer with something like this:
v_counter = 1;
While ( TABDIM(Cube, v_counter) @<> '' );
sDim = TabDim(Cube, v_counter);
IF(v_counter = 1);
v_Dim_at_DimIndex1 = sDim;
ElseIF(v_counter = 2);
v_Dim_at_DimIndex2 = sDim;
ElseIF(v_counter = 3);
v_Dim_at_DimIndex3 = sDim;
.
.
.
But it didn't work!
Now the question:
Is there a way to solve this problem?
Thank you for your help!!!!!
-
- MVP
- Posts: 3706
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Load data from dynamic CubeView
I can't really understand exactly what you are asking but if you want a detailed worked example of how to manage dynamically assigning views and filters to copy data look up the process bedrock.cube.data.copy
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
-
- Posts: 4
- Joined: Thu Jan 08, 2015 1:27 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2007
Re: Load data from dynamic CubeView
thank you for the fast answer.What do you mean with this "bedrock.cube.data.copy" ?
do I have to search this within a special guide?
The process that I want to creat has to be intelligent and should work for many different cubes.
For example:
Cube1
Dim1 = Currency
Dim2 = Week
Dim3 = PV -> source element is 'PV1'
Cube1 should be copied to
Cube1
Dim1 = Currency
Dim2 = Week
Dim3 = PV -> target element is 'PV6'
The next time, the same process will be called to copy another cube:
Cube2
Dim1 = PV -> source element is 'PV3'
Dim2 = Team
Dim3 = Measure
Dim4 = Region
Cube2 should be copied to
Cube2
Dim1 = PV -> target element is 'PV4'
Dim2 = Team
Dim3 = Measure
Dim4 = Region
I need to use a CellPutN() within the data tab to copy the source into the target.
The Syntax for this formula is CellPutN(x, Cube, e1, e2 [,...en]);
what is missing is the number of e1,...en and the information if the dimension 'PV' is like e1 or e3 ......
do I have to search this within a special guide?
The process that I want to creat has to be intelligent and should work for many different cubes.
For example:
Cube1
Dim1 = Currency
Dim2 = Week
Dim3 = PV -> source element is 'PV1'
Cube1 should be copied to
Cube1
Dim1 = Currency
Dim2 = Week
Dim3 = PV -> target element is 'PV6'
The next time, the same process will be called to copy another cube:
Cube2
Dim1 = PV -> source element is 'PV3'
Dim2 = Team
Dim3 = Measure
Dim4 = Region
Cube2 should be copied to
Cube2
Dim1 = PV -> target element is 'PV4'
Dim2 = Team
Dim3 = Measure
Dim4 = Region
I need to use a CellPutN() within the data tab to copy the source into the target.
The Syntax for this formula is CellPutN(x, Cube, e1, e2 [,...en]);
what is missing is the number of e1,...en and the information if the dimension 'PV' is like e1 or e3 ......
-
- 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: Load data from dynamic CubeView
As far as the PV1 thing is concerned, can't you just do this:
Code: Select all
IF(pVariable_to_Assign_PV1 = 1);
V1 = 'PV1';
ElSEIF(pVariable_to_Assign_PV1 = 2):
V2 = 'PV1';
ElSEIF(pVariable_to_Assign_PV1 = 3):
V3 = 'PV1';
........
ElSEIF(pVariable_to_Assign_PV1 = x):
Vx = 'PV1';
-
- Posts: 4
- Joined: Thu Jan 08, 2015 1:27 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2007
Re: Load data from dynamic CubeView
what I tried till now is the following:
I know that there is no cube with more then 20 dimensions included.
PROLOG
DATA
The v_number_of_Dimensions can tell me how many e1,...en I need to use.
But how can I check in a clever way which [,...en] is the PV Dimension. Do I need again an if statement with 19 ElseIf parts?
and how can I combine those information without getting really long code?
I'm lost....
I know that there is no cube with more then 20 dimensions included.
PROLOG
Code: Select all
##################
# Definition der Quelle
##################
DatasourceNameForServer = p_Cube;
DataSourceType = 'View';
DatasourceCubeview = V_Name;
DATA
Code: Select all
# find index of dimension PV in actual cube
#####################################
v_counter = 1;
While ( TABDIM(p_Cube, v_counter) @<> '' );
sDim = TabDim(p_Cube, v_counter);
IF(v_counter = 1);
v_Dim_at_DimIndex1 = sDim;
ElseIF(v_counter = 2);
v_Dim_at_DimIndex2 = sDim;
ElseIF(v_counter = 3);
v_Dim_at_DimIndex3 = sDim;
ElseIF(v_counter = 4);
v_Dim_at_DimIndex4 = sDim;
ElseIF(v_counter = 5);
v_Dim_at_DimIndex5 = sDim;
ElseIF(v_counter = 6);
v_Dim_at_DimIndex6 = sDim;
ElseIF(v_counter = 7);
v_Dim_at_DimIndex7 = sDim;
ElseIF(v_counter = 8);
v_Dim_at_DimIndex8 = sDim;
ElseIF(v_counter = 9);
v_Dim_at_DimIndex9 = sDim;
ElseIF(v_counter = 10);
v_Dim_at_DimIndex10 = sDim;
ElseIF(v_counter = 11);
v_Dim_at_DimIndex11 = sDim;
ElseIF(v_counter = 12);
v_Dim_at_DimIndex12 = sDim;
ElseIF(v_counter = 13);
v_Dim_at_DimIndex13 = sDim;
ElseIF(v_counter = 14);
v_Dim_at_DimIndex14 = sDim;
ElseIF(v_counter = 15);
v_Dim_at_DimIndex15 = sDim;
ElseIF(v_counter = 16);
v_Dim_at_DimIndex16 = sDim;
ElseIF(v_counter = 17);
v_Dim_at_DimIndex17 = sDim;
ElseIF(v_counter = 18);
v_Dim_at_DimIndex18 = sDim;
ElseIF(v_counter = 19);
v_Dim_at_DimIndex19 = sDim;
ElseIF(v_counter = 20);
v_Dim_at_DimIndex20 = sDim;
EndIf;
v_counter = v_counter + 1;
End;
v_number_of_Dimensions = v_counter -1;
Code: Select all
If (v_number_of_Dimensions = 2);
CellPutN(x, Cube, e1, e2);
ElseIF(v_number_of_Dimensions = 3);
CellPutN(x, Cube, e1, e2, e3);
.
.
.
.
But how can I check in a clever way which [,...en] is the PV Dimension. Do I need again an if statement with 19 ElseIf parts?
Code: Select all
If (v_Dim_at_DimIndex1 = 'PV');
e1 = 'PV';
CellPutN(x, Cube, e1, e2);
If (v_Dim_at_DimIndex2 = 'PV');
e2 = 'PV';
CellPutN(x, Cube, e1, e2);
.
.
.
.
I'm lost....

-
- MVP
- Posts: 3706
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Load data from dynamic CubeView
Look up www.bedrocktm1.org I think it has all your requirements pretty much covered.
You will be making more effective use of your time starting from a library and understanding the code there and then maybe adapting some of it than trying to do it yourself from scratch.
You will be making more effective use of your time starting from a library and understanding the code there and then maybe adapting some of it than trying to do it yourself from scratch.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
-
- 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: Load data from dynamic CubeView
You can also look at the below link:
http://www.tm1forum.com/viewtopic.php?f ... 659#p18659 Thanks
http://www.tm1forum.com/viewtopic.php?f ... 659#p18659 Thanks
"You Never Fail Until You Stop Trying......"
-
- Posts: 4
- Joined: Thu Jan 08, 2015 1:27 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2007
Re: Load data from dynamic CubeView
the last 2 answers helped me to finish my work.
Thanks for the fast and good help!
In case I need to close this request please tell me how to do it -> I don't want to waste the time of others
Thanks for the fast and good help!
In case I need to close this request please tell me how to do it -> I don't want to waste the time of others

-
- 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: Load data from dynamic CubeView
Hi Bianca ,Your reply is as good as closing the issue,That will do.Thanks 

"You Never Fail Until You Stop Trying......"