# Cross Year Enterprise Rule

I'm trying to program a cash flow statement and was wondering how best to handle the change calculating the change in Accounts Receivable (or other working capital account).

To calculate the change in February 2013, I would subtract ['2013'.'Feb','AR'] - [''2013','Jan','AR']. Is there a more generic / parameter-base approach to do this Also, how would you handle the situation where you are calculating the change in AR for January. In this case you have to cross two dimensions Months and Year. ['2013','Jan','AR'] - ['2013,'Dec','AR'].

What's the best practice for handling this.

Thanks for you input.
Hi,

I use the following formula for periodic carry forward. It's quite database and cube agnostic given that you have separate year and period dimensions and you maintain element in chronological order. Other that that you only need to replace few element and dimension names.

### Source Code

1. ['Opening']=B:IF(PALO.EINDEX("DB","Period",!'Period')==1,IF(PALO.EINDEX("DB","Year",!'Year')==1,STET(),PALO.DATA("DB","Cube","Dec",PALO.EPREV("DB","Year",!'Year'),"Closing",!'Other dims')),PALO.DATA("DB","Cube",PALO.EPREV("DB","Period",!'Period'),!'Year',"Closing",!'Other dims'))

First it checks if it's first period dim element and then shifts to prior year dim element. Additionally it checks if year element is first and stops calculation since there is o opening value.

For any other period it just gets the value from prior period.

Hope this helps,