Relative Proportional Spread

Post Reply
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Relative Proportional Spread

Post by jim wood »

Guys,

There is the TI function called CellPutProportionalSpread. Do you know if there an undocumented function within TI that will do Relative proportional spreads?

Thanks,

Jim.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
tomok
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: Relative Proportional Spread

Post by tomok »

jim wood wrote:Guys,

There is the TI function called CellPutProportionalSpread. Do you know if there an undocumented function within TI that will do Relative proportional spreads?

Thanks,

Jim.
Do you mean something like, spread into Column B, based on the values in Column A? If that's the question, then no. However, you can achieve the same results with CellPutProportionalSpread in three steps:
1) Clear column B
2) Load values from Column A into Column B
3) Use CellPutProportionalSpread with total dollar amount of Column A, into top most node in Column B.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Relative Proportional Spread

Post by Duncan P »

... or if you meant "spread a 10% increase across the leaf descendents of ..." you could do

Code: Select all

CellPutProportionalSpread( 1.1 * CellGetN( 'cube', 'dim1' , ..., 'dimN' ), 'cube', 'dim1, ..., 'dimN' );
... or if you meant "add 100 to every leaf descendent ..." you are out of luck.
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Relative Proportional Spread

Post by declanr »

Duncan P wrote:... or if you meant "add 100 to every leaf descendent ..." you are out of luck.
Although not a specific function this still isn't difficult to achieve;

IF(ELISANC(pParent,v1)=1);
CellPutN(100+CellGetN(Cube,v1,v2,v3,v4),Cube,v1,v2,v3,v4);
ENDIF;


You just need to make sure that the datasource doesn't result in a loop or elements appearing more than once.
Declan Rodger
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Relative Proportional Spread

Post by Duncan P »

The only problem is iterating over the leaf descendent cells of the cell to which you want to do this. If at the time that you are writing the TI you know the dimensionality of the cube in which you wish to do it then you can make a set of nested loops, one for each dimension, and progressively iterate over their members. If you are writing a generic TI, like those in Bedrock then it's a lot more difficult - but still possible.
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Relative Proportional Spread

Post by jim wood »

Thanks for the replies guys. You've given me plenty to chew on. I was going to use the elisanc approach but the problem is they want to spread the value across multiple dimensions. While this doesn't rule this approach it does mean coding and testing it will be a lot of fun,

Jim.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Relative Proportional Spread

Post by Duncan P »

An alternative method of iterating might be to create a temporary subset on each dimension with the leaf descendents in (either manually or by MDX), create a temporary view from the subsets and then use the view as the source for a sub-process that uses its process variables as cell coordinates and does the relevant work on the cells. If you wanted to put data into every cell, whether currently populated or not, you would need to call ViewExtractSkipZeroesSet with false.
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Relative Proportional Spread

Post by jim wood »

I think we going to go for the method Tomok mentioned. We already have no data so we don't have to worry about that. What we are going to do is create a numeric attribute for each dimension involved and and calculate a ratio (for the attribute) for every element based on the number of children of it's parent. We can load these values and complete an effective even spread. That's the theory anyway.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Post Reply