Skip to Content
0
Former Member
Nov 11, 2009 at 06:35 AM

LOOKUP RATES with %YEAR%

30 Views

Hi experts,

I have a piece of script logic that works pretty well except for selecting a time period from the RATES App. While I can work around it would be better to have a flexible solution. In this example we load ex.rates JAN - DEC for all years but the conversion only applies to CCYY.INPUT. I can make it work using ex.rates entered for this period but I wanted to use CCYY.JAN or DEC.

When I try to use %YEAR%.JAN in the lookup I get "invalid dimension/member" errors.

e.g.

// Convert USD targets to local currency

*XDIM_MEMBERSET CATEGORY = TARGET

*XDIM_MEMBERSET ACCOUNT = 41100 //Revenue

*XDIM_MEMBERSET CURRENCY = USD

*XDIM_MEMBERSET TIME = %TIME_SET%

// Lookup ex.rates

*LOOKUP RATES

*DIM RATETYPE = ACCOUNT.RATETYPE

*DIM CATEGORY = "BUDGET"

*DIM ENTITY = "GLOBAL_INPUT"

DIM TIME = "%YEAR%.JAN*"

*DIM SRC_CURR:CURRENCY = CURRENCY

*DIM LC_CURR:CURRENCY = ENTITY.CURRENCY

*ENDLOOKUP

// copy and calculate local currency (divide by zero is OK)

*WHEN CURRENCY.MD

*IS "D"

*REC(FACTOR=LOOKUP(LC_CURR) / LOOKUP(SRC_CURR), CURRENCY=LC)

*IS "M"

*REC(FACTOR=LOOKUP(SRC_CURR) / LOOKUP(LC_CURR), CURRENCY=LC)

*ENDWHEN

*COMMIT

-


Any suggestions would be appreciated.

Cheers,

Graeme.