Skip to Content
0

Help on Performance of Currency Translation Script Logic

Oct 21, 2016 at 08:34 AM

32

avatar image
Former Member

Hello there,

I've put together script below for currency conversion. Using Business rule is not an option because we need values to be posted to certain group code (scope) and not otherwise.

However the package takes too long (37 minutes). Any idea in enhancing the performance?

****BEGIN****

*SELECT(%ACCSET_AVG%,"[ID]",ACCOUNT,"[RATETYPE]='AVG'") *SELECT(%ACCSET_CLO%,"[ID]",ACCOUNT,"[RATETYPE]='CLO'") *LOOKUP Rates *DIM R_ENTITY=Global *DIM DCURR1:INPUTCURRENCY="USD" *DIM DCURR2:INPUTCURRENCY="CAD" *DIM SCURR:INPUTCURRENCY=ENTITY.CURRENCY *DIM R_ACCOUNT = ACCOUNT.RATETYPE //*DIM CATEGORY=Actual //*DIM TIME=2015.01 *ENDLOOKUP *XDIM_MEMBERSET TIME=%TIME_SET% *XDIM_MEMBERSET CATEGORY=%CATEGORY_SET% *XDIM_MEMBERSET ENTITY=%ENTITY_SET% *XDIM_MEMBERSET RPTCURRENCY=LC *XDIM_MEMBERSET SCOPE=S_NONE *FOR %ACCTS_AVG% = %ACCSET_AVG% *WHEN ACCOUNT *IS %ACCTS_AVG% *REC(FACTOR=LOOKUP(SCURR)/LOOKUP(DCURR1), RPTCURRENCY="USD",SCOPE="S_CMINV") *REC(FACTOR=LOOKUP(SCURR)/LOOKUP(DCURR2), RPTCURRENCY="CAD",SCOPE="S_CMINV") //*REC(FACTOR=LOOKUP(DCURR2), RPTCURRENCY="CAD",SCOPE=S_CMINV) *ENDWHEN *NEXT //***************CLO******************// *FOR %ACCTS_CLO% = %ACCSET_CLO% *WHEN ACCOUNT *IS %ACCTS_CLO% //*WHEN ACCOUNT //*IS 400000,500000,600000 *REC(FACTOR=LOOKUP(SCURR)/LOOKUP(DCURR1), RPTCURRENCY="USD",SCOPE="S_CMINV") *REC(FACTOR=LOOKUP(SCURR)/LOOKUP(DCURR2), RPTCURRENCY="CAD",SCOPE="S_CMINV") *ENDWHEN *NEXT

****END*****

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers