# Differences between periods

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

• # Differences between periods

I am facing the following question (hopefully not too confusing ;-)):

I am working on a cash flow model. For this calculation I have to calculate the difference beween the actual value for the month and the value for the previous period.

Example:

DIM_Time: JAN FEB MAR
Value0001: 100 200 300
.
.
.
.
.
Value9999: 400 600 400

DiffValue001: ... (FEB-JAN)
.
.
.

Of course I could create a rule that Difference_Value001_FEB=FEB-JAN, but that would mean that I have to create thousands of rules which I would like to avoid.

Does anyone have an idea?

Regards
s.
• # RE: Differences between periods

Hello Scotty,

I once tried something similar. The idea was to set a start balance for every period to the end balance of the previous period. Here is how I did it ("AB" is for start_balance and "EB" for end_balance):

['AB'] =
IF((PALO.EINDEX("db","Month",!'Month') + PALO.EINDEX("db","year",!'year')) == 2,STET(),

PALO.DATA("db","balance",!'costcenter',!'balance',
IF(PALO.EINDEX("db","month",!'month') != 1,!'year',
PALO.EPREV("db","year",!'year')),
IF(PALO.EINDEX("db","month",!'month') > 1,
PALO.EPREV("db","month",!'month'),PALO.ENAME("db","month",12)),!'Version',"EB"))

But the whole thing made the model so slow that I deleted it again. I tend to solve these things inside the report if I have a chance to, I believe a MOLAP database cannot cope with that kind of rules when it comes to performance.

Sorry for all the mad faces, that is what the software makes out of an "X"

Regards
Holger

The post was edited 1 time, last by holger_b ().

• did you try working in the time dimension?

e.g. diff_FEB=FEB-JAN

so you create extra "diff_" elements in the time hierarchy and look at these

The post was edited 1 time, last by axi ().

• Thank you ... still fighting