How to Identity the maximum balance for combination from two combination. TM1 TI Process.

Post Reply
Ashleigh W
Posts: 88
Joined: Mon Oct 24, 2016 1:21 pm
OLAP Product: TM1
Version: TM1 Perspectives 10
Excel Version: Excel 2016

How to Identity the maximum balance for combination from two combination. TM1 TI Process.

Post by Ashleigh W »

Hi all,

I'm trying to find which CostCenter and Location dimension combination hold maximum Expense. Sample data and my expected result provide below.
Please advice best way to complete this task.

thanks in advance.

costCenter locNo Expense
49999 LOC1 13048
49999 LOC2 77904 <<-
49999 LOC3 2466
49998 LOC4 5271
49998 LOC5 82183
49998 LOC6 32182
49998 LOC7 83274 <<-
User avatar
Steve Rowe
Site Admin
Posts: 2417
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: How to Identity the maximum balance for combination from two combination. TM1 TI Process.

Post by Steve Rowe »

You should just be able to put something like this.

#Prolog
nMax=0;
sCC='';
sLocNo='';

#Data
If( nValue>nMax);
nMax= nValue ;
sCC=vCC;
sLocNo=vLocNo
End;

#Where nValue, vCC and vLocNo all come from your datasource
Technical Director
www.infocat.co.uk
Wim Gielis
MVP
Posts: 3117
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: How to Identity the maximum balance for combination from two combination. TM1 TI Process.

Post by Wim Gielis »

Hello

I would also use a TI process with a view as the data source.
The way I interpret the question, is that you could build a small 2D cube with Costcenter and a measures dimension.
Or a couple of attributes would also work instead of an extra cube.
I guess that you want to know, for each Costcenter, what is the location that has the maximum value. You also want to know that value.

Do a CubeClearData function on that cube in the Prolog of your process.
Then loop over a view and use the logic that Steve wrote above to update your second cube.
In the measures dimension you would have elements such as Location (string type) and Max_Value (numeric type).
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Ashleigh W
Posts: 88
Joined: Mon Oct 24, 2016 1:21 pm
OLAP Product: TM1
Version: TM1 Perspectives 10
Excel Version: Excel 2016

Re: How to Identity the maximum balance for combination from two combination. TM1 TI Process.

Post by Ashleigh W »

thanks Guys for helping out. this is huge help.

Ashleigh
Post Reply