Page 1 of 1

Sum Accumulated using rule

Posted: Thu Apr 03, 2014 8:09 am
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

Re: Sum Accumulated using rule

Posted: Thu Apr 03, 2014 8:49 am
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.

Re: Sum Accumulated using rule

Posted: Thu Apr 03, 2014 2:04 pm
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'

Re: Sum Accumulated using rule

Posted: Tue Apr 08, 2014 3:16 am
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.