Sum Accumulated using rule

Post Reply
ChauBSD
Posts: 55
Joined: Wed Jun 27, 2012 3:22 am
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Contact:

Sum Accumulated using rule

Post by ChauBSD »

Hi everyone

I have case calculation Accumulated

Image

I want to calculation

Accumulated Phase 1= Rate Phase 1
Accumulated Phase 2= Accumulated Phase 1 + Rate Phase 2
Accumulated Phase 3= Accumulated Phase 2 + Rate Phase 3
v.v.v

Thanks you
Wim Gielis
MVP
Posts: 3241
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Sum Accumulated using rule

Post by Wim Gielis »

Isn't this just a simple structure of consolidations in a dimension?
And if you use rules, which is perfectly fine too, what is the problem that you face?
But actually I would go for consolidations instead of rules.
Best regards,

Wim Gielis

IBM Champion 2024-2025
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
ardi
Community Contributor
Posts: 165
Joined: Tue Apr 02, 2013 1:41 pm
OLAP Product: tm1, cognos bi
Version: from TM1 9.4 to PA 2.0.9.6
Excel Version: 2010
Location: Toronto, ON

Re: Sum Accumulated using rule

Post by ardi »

I would create 2 attributes for your Phase dimensions , lets say Previous Phase and Next Phase, same idea as in a Period Dimension

Then you can write a rule to calculate the value of Accumulated Measure:

['Accumulated'] = IF ( ATTRS ( 'phase_dim' , !phase_dim , 'Previous Phase' ) @= '' , DB('cube_name' , !dim1 , !phase_dim ,,,, 'Rate' ) ,
DB('cube_name' , !dim1 , ATTRS ( 'phase_dim' , !phase_dim , 'Previous Phase' ) ,,,, 'Accumulated' ) + DB('cube_name' , !dim1 , !phase_dim ,,,, 'Rate' )
) ;

When you write a feeder statement, you feed 'Next Phase'
Ardian Alikaj
ChauBSD
Posts: 55
Joined: Wed Jun 27, 2012 3:22 am
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Contact:

Re: Sum Accumulated using rule

Post by ChauBSD »

ardi wrote:I would create 2 attributes for your Phase dimensions , lets say Previous Phase and Next Phase, same idea as in a Period Dimension

Then you can write a rule to calculate the value of Accumulated Measure:

['Accumulated'] = IF ( ATTRS ( 'phase_dim' , !phase_dim , 'Previous Phase' ) @= '' , DB('cube_name' , !dim1 , !phase_dim ,,,, 'Rate' ) ,
DB('cube_name' , !dim1 , ATTRS ( 'phase_dim' , !phase_dim , 'Previous Phase' ) ,,,, 'Accumulated' ) + DB('cube_name' , !dim1 , !phase_dim ,,,, 'Rate' )
) ;

When you write a feeder statement, you feed 'Next Phase'

Thanks you very much.
Post Reply