Probability Average aggregation

Post Reply
daya007
Posts: 49
Joined: Fri May 28, 2010 4:47 am
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2003
Location: IL, USA

Probability Average aggregation

Post by daya007 »

Hi
I have a cube with time dimension and in measure dim i have probability element. But theoretically probability of quarter 1 is not equal to sum of probability of jan, feb, mar. It is average of jan,feb,mar. TM1 always aggregates values as sum. How do i change it to average. I have time dim with hierarchy TotalYears->(years from 1990-2011)->Quarters->Month. Same type of aggregation(Avg) must reflect to all consolidations. How can i do that. Please help me.

Thanks
Daya
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: Probability Average aggregation

Post by kpk »

Do you have one time dimension with hierarchy like this?

2010
-2010Q1
--201001
--201002
--201003
-2010Q2
--201004
--201005
--201006
...
Best Regards,
Peter
daya007
Posts: 49
Joined: Fri May 28, 2010 4:47 am
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2003
Location: IL, USA

Re: Probability Average aggregation

Post by daya007 »

Thanks for the reply
hierarchy is shown in the attachment.
daya007
Posts: 49
Joined: Fri May 28, 2010 4:47 am
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2003
Location: IL, USA

Re: Probability Average aggregation

Post by daya007 »

i dono if ur able to c the attachment...ill type in
its like

Total year
1990
1990-1Q
January 1990
February 1990
March 1990
1990-2Q
April 1990
- -
--
--
--
--
2010
2010-1Q
January 2010
February 2010
March 2010
2010-2Q
April 2010
--
--
--
--
--
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: Probability Average aggregation

Post by kpk »

Hi,

One working approach is using alternative hierarchies to support the calculation.

1. Create an alternative hierarchy like this in which you will always sum-up the values on C level elements
2010-Sum
2010-1Q-Sum
January 2010
February 2010
March 2010
2010-2Q-Sum
April 2010

2. Create rule to calculate the average for the original C level elements
['Total year']=0; (optional)

['Probability']=C:
IF(LONG(!timedimensionname)=4,DB(cubename,.....,timedimensionname|'-Sum',.....)/12,
IF(LONG(!timedimensionname)=7,DB(cubename,.....,timedimensionname|'-Sum',.....)/3,STET));

HTH

PS: sometimes (especially in reporting cubes) you have to solve other issues with averages when you have unfinished quarters or years
in which not all months has value and therefore seeing the values of Q-Sum/3 or Y-Sum/12 is not meaningful for the end users.

Kind Regards,
Peter
Best Regards,
Peter
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: Probability Average aggregation

Post by kpk »

Sorry, "!" is required in the DB() function in front of your time dimension name.

['Probability']=C:
IF(LONG(!timedimensionname)=4,DB(cubename,.....,!timedimensionname|'-Sum',.....)/12,
IF(LONG(!timedimensionname)=7,DB(cubename,.....,!timedimensionname|'-Sum',.....)/3,STET));
Best Regards,
Peter
daya007
Posts: 49
Joined: Fri May 28, 2010 4:47 am
OLAP Product: TM1
Version: 9.5.1
Excel Version: 2003
Location: IL, USA

Re: Probability Average aggregation

Post by daya007 »

Thank you so much for ur reply.
But the problem is..not all months has data in it...cuz of this we get a wrong calculation if we divide by 12 or 3 for year/Quarter.
Consider 2010, it has data upto june. How can we solve such a problem.
Please help.
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: Probability Average aggregation

Post by kpk »

daya007 wrote:Thank you so much for ur reply.
But the problem is..not all months has data in it...cuz of this we get a wrong calculation if we divide by 12 or 3 for year/Quarter.
Consider 2010, it has data upto june. How can we solve such a problem.
Please help.
It depends on what your users would like to see and how they would like to control the valid periods.
E.g. you can create a lookup cube to flag the valid periods by 1 and change the calculation a bit:

['Probability']=C:
IF(LONG(!timedimensionname)=4,DB(cubename,.....,!timedimensionname|'-Sum',.....)/DB('lookupcubename',!timedimensionname,'ValidPeriods'),
IF(LONG(!timedimensionname)=7,DB(cubename,.....,!timedimensionname|'-Sum',.....)/DB('lookupcubename',!timedimensionname,'ValidPeriods'),STET));

The flags can be updated manually or in a TI process after uploading the actuals into your report cube.
Best Regards,
Peter
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: Probability Average aggregation

Post by kpk »

Use \ instead of /
['Probability']=C:
IF(LONG(!timedimensionname)=4,DB(cubename,.....,!timedimensionname|'-Sum',.....)\DB('lookupcubename',!timedimensionname,'ValidPeriods'),
IF(LONG(!timedimensionname)=7,DB(cubename,.....,!timedimensionname|'-Sum',.....)\DB('lookupcubename',!timedimensionname,'ValidPeriods'),STET));
Best Regards,
Peter
User avatar
Martin Ryan
Site Admin
Posts: 2003
Joined: Sat May 10, 2008 9:08 am
OLAP Product: TM1
Version: 10.1
Excel Version: 2010
Location: Wellington, New Zealand
Contact:

Re: Probability Average aggregation

Post by Martin Ryan »

There are a few other general ideas for averages in this post: http://forums.olapforums.com/viewtopic.php?f=21&t=388 I think Method 2 will probably work pretty well for you.

Martin
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Post Reply