Skip to content

Instantly share code, notes, and snippets.

@webbyworks
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webbyworks/5b3d9f7627a68217d6f8 to your computer and use it in GitHub Desktop.
Save webbyworks/5b3d9f7627a68217d6f8 to your computer and use it in GitHub Desktop.
Calculates the Opening Weekly Balance of our Cash Flow Cube Sheet in Adaptive Planning. Assuming that there is a standard account listing the Initial Opening Balance of the fiscal year (code: OBal) it will then find the previous Closing Balance figure from the prior week to be the Opening Balance of the active week.
if ( isBlank( ASSUM.CF.WeekNum ), 0,
if ( isBlank( ACCT.CF.OBal ),
if ( ASSUM.CF.WeekNum = 1,
if ( ASSUM.WksMonth[time=this-1] = 5, ACCT.CF.CBalWeekly[time=this-1,Weeks=Week 5], ACCT.CF.CBalWeekly[time=this-1,Weeks=Week 4])
,
if( ASSUM.CF.WeekNum = 2, ACCT.CF.CBalWeekly[Weeks=Week 1],
if ( ASSUM.CF.WeekNum = 3, ACCT.CF.CBalWeekly[Weeks=Week 2],
if ( ASSUM.CF.WeekNum = 4, ACCT.CF.CBalWeekly[Weeks=Week 3],
if ( ASSUM.CF.WeekNum = 5 AND ASSUM.WksMonth = 5, ACCT.CF.CBalWeekly[Weeks=Week 4], 0 )
)
)
)
)
,
ACCT.CF.OBal
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment