I am going to write a process to repeat spread some initial number in TM1, but there is only CellPutProportionalSpread or CellIncrementN function descripted in TM1 reference manual.
Is there any function to do repeat spread in TI ?
Regards,
Chris
DataSpreading function in TI
-
- Posts: 122
- Joined: Thu Jan 31, 2013 1:03 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2007
-
- Community Contributor
- Posts: 217
- Joined: Thu Aug 15, 2013 9:05 am
- OLAP Product: TM1
- Version: 10.2.1.1
- Excel Version: 14.0.6129.5000
Re: DataSpreading function in TI
Hello Chris,
For example:
That is a very basic way of putting 999 into every selected intersection of the cube. You can always write while loops inside other loops in order to pass multiple arguments into the CellPutN function. You could always use more than one CellPutN function call.
So, there is no one function to help you with this, but it is possible with other TI functions. You can always import a flat file into the cube aswell.
Let me know if I can explain in more detail.
Thanks.
There is no function that will perform this task in of its self, but you could also create a while loop and pass in arguments to the CellPutN function.Is there any function to do repeat spread in TI ?
For example:
Code: Select all
x = 1;
While(x < DIMSIZ('Dim1'));
vEl = DIMNM('Dim1',vEl);
CellPutN(999,'CubeName',vEl,'Dim2');
x = x + 1;
End;
So, there is no one function to help you with this, but it is possible with other TI functions. You can always import a flat file into the cube aswell.
Let me know if I can explain in more detail.
Thanks.
-
- 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: DataSpreading function in TI
Thanks a lot TrevorGoss ,Could you please expand bit on this part
on above on the same scenario(Data Spreading function in TI)You can always write while loops inside other loops in order to pass multiple arguments into the CellPutN function. You could always use more than one CellPutN function call
"You Never Fail Until You Stop Trying......"
-
- Community Contributor
- Posts: 217
- Joined: Thu Aug 15, 2013 9:05 am
- OLAP Product: TM1
- Version: 10.2.1.1
- Excel Version: 14.0.6129.5000
Re: DataSpreading function in TI
Hello BariAbdul,
For example, if you wanted to place data around one Cube, you could use the TABDIM function. This function returns the dimension based off the cube and the order number of the dimension.
So...Cube1:Dim1:Dim2:Dim3....TABDIM('Cube1',1) = Dim1
To loop around the cube and return the dimension you could use:
You will then have a loop which will give you a dimension inside the selected cube for every time the while loop continues. you could then loop around that dimension and pass every element of it into the CellPutS function. You could do this for each dimension in the said cube.
For example:
You could do this for each dimension in the cube.
The main purpose of this type of TI script is to work with the data that is given to you by controlling the flow of the program. You can grab returned values based off your looping around cubes and dimensions, to pass the needed metadata into the CellPutS Function.
It is always a good idea to use the "CellIsUpdateable" function when using the CellPut functions. For example If(CellIsUpdateable('Cube1',vEl,Dim2,Dim3)=1); (CellPutS('Cube1',vEl,Dim2,Dim3); EndIf;
This helps you avoid the attempt to put write to cells that cannot be written to, such as rule derived cells and C level.
Hope this helps.
For example, if you wanted to place data around one Cube, you could use the TABDIM function. This function returns the dimension based off the cube and the order number of the dimension.
So...Cube1:Dim1:Dim2:Dim3....TABDIM('Cube1',1) = Dim1
To loop around the cube and return the dimension you could use:
Code: Select all
x = 1;
While(TABDIM('Cube1',x)@<>'')
vDim = TABDIM('Cube1',x);
x = x + 1;
End;
For example:
Code: Select all
x = 1;
While(TABDIM('Cube1',x)@<>'')
vDim = TABDIM('Cube1',x);
vDimSizCount = DIMIX(vDim);
y=1;
While(y < vDimSizCount);
vEl = DIMNM(vDim,y);
CellPutS('Cube1',vEl,Dim2,Dim3);
x = x + 1;
End;
The main purpose of this type of TI script is to work with the data that is given to you by controlling the flow of the program. You can grab returned values based off your looping around cubes and dimensions, to pass the needed metadata into the CellPutS Function.
It is always a good idea to use the "CellIsUpdateable" function when using the CellPut functions. For example If(CellIsUpdateable('Cube1',vEl,Dim2,Dim3)=1); (CellPutS('Cube1',vEl,Dim2,Dim3); EndIf;
This helps you avoid the attempt to put write to cells that cannot be written to, such as rule derived cells and C level.
Hope this helps.
-
- 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: DataSpreading function in TI
Thanks a lot,Really helpful.
"You Never Fail Until You Stop Trying......"
-
- Posts: 122
- Joined: Thu Jan 31, 2013 1:03 pm
- OLAP Product: TM1
- Version: 10.2
- Excel Version: 2007
Re: DataSpreading function in TI
Thank you, TrevorGoss.
Your suggestion is very helpful.
Your suggestion is very helpful.