cancel
Showing results for 
Search instead for 
Did you mean: 

Script Logic - Division operator not working in *REC statement

0 Kudos

Script logic is not working as expected when trying to divide two specific records. All of the members mentioned in the formula are base level. The amount written back to the data base is 0. Based on the scoping statement there are two source records in the database. The *REC statement is attempting to divide these two records (-1.5 billion divided 41 million). by By changing the “/” operator to a “+” I notice the formula behaves as expected (-1.5 billion + 41 million). Please advise on how to correct the formula so that the division works properly.

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET DATASRC = D_BPCSKF

*XDIM_MEMBERSET INTERCO = P_NO_INTERCO

*XDIM_MEMBERSET RPTCURRENCY = USD

*XDIM_MEMBERSET SCOPE = G_0001

*XDIM_MEMBERSET TTYPE = F_NO_TTYPE

*XDIM_MEMBERSET COMPANY = CO_600

*XDIM_MEMBERSET CCPC = C_NO_CCPC

*XDIM_MEMBERSET VERSION = ACTUAL

*XDIM_MEMBERSET ACCOUNT = SKF_00352_CALC1,SKF_00352_CALC2

*WHEN ACCOUNT

*IS *

*REC(EXPRESSION= [ACCOUNT].[SKF_00352_CALC1] / [ACCOUNT].[SKF_00352_CALC2],ACCOUNT="SKF_00352",FSGAAP="AC_SKF_00352",DATASRC="D_BPCSKF",INTERCO="P_NO_INTERCO",RPTCURRENCY="USD",SCOPE="G_0001",TTYPE="F_NO_TTYPE",COMPANY="CO_600",CCPC="C_NO_CCPC")

*ENDWHEN

*COMMIT

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

After you have provided the data sample the issue is clear!

You have not only 2 accounts, but 2 FSGAAP: AC_SKF_00352_CALC1 and AC_SKF_00352_CALC2

Then you need tuple:

*REC(EXPRESSION=%VALUE%/([ACCOUNT].[SKF_00352_CALC2],[FSGAAP].[AC_SKF_00352_CALC2]),ACCOUNT="SKF_00352",FSGAAP="AC_SKF_00352")

0 Kudos

Thank you Vadim!

Answers (2)

Answers (2)

0 Kudos

Hi Vadim, thanks for your reply.. please see below

These are the source records (1st image attached) I am trying to divide using script logic:

Per your previous comment I have updated the script:

*XDIM_MEMBERSET TIME = %TIME_SET%

*XDIM_MEMBERSET DATASRC = D_BPCSKF

*XDIM_MEMBERSET INTERCO = P_NO_INTERCO

*XDIM_MEMBERSET RPTCURRENCY = USD

*XDIM_MEMBERSET SCOPE = G_0001

*XDIM_MEMBERSET TTYPE = F_NO_TTYPE

*XDIM_MEMBERSET COMPANY = CO_600

*XDIM_MEMBERSET CCPC = C_NO_CCPC

*XDIM_MEMBERSET VERSION = ACTUAL

*XDIM_MEMBERSET ACCOUNT = SKF_00352_CALC1

*XDIM_MEMBERSET FSGAAP = AC_SKF_00352_CALC1

*WHEN ACCOUNT

*IS *

*REC(EXPRESSION=%VALUE%/[ACCOUNT].[SKF_00352_CALC2],ACCOUNT="SKF_00352",FSGAAP="AC_SKF_00352")

*ENDWHEN

In response to your comment "In REC there is no reason to provide not changed dimensions!", the Account and FSGAAP are both changed hence the reason I am mentioning them specifically in the *REC statement.

Here is the result of the script logic log (2nd image attached), still the amount written back is 0.00

script-logic-dmp-log.png

Kindly advise on what further changes are needed.

former_member186338
Active Contributor
0 Kudos

Strange script!

The division will be performed twice - due to both records are scoped! Try to scope single account:

*XDIM_MEMBERSET TIME = %TIME_SET%
*XDIM_MEMBERSET DATASRC = D_BPCSKF
*XDIM_MEMBERSET INTERCO = P_NO_INTERCO
*XDIM_MEMBERSET RPTCURRENCY = USD
*XDIM_MEMBERSET SCOPE = G_0001
*XDIM_MEMBERSET TTYPE = F_NO_TTYPE
*XDIM_MEMBERSET COMPANY = CO_600
*XDIM_MEMBERSET CCPC = C_NO_CCPC
*XDIM_MEMBERSET VERSION = ACTUAL
*XDIM_MEMBERSET ACCOUNT = SKF_00352_CALC1 //Single account!
//*XDIM_MEMBERSET FSGAAP = ??? What is the scope?
 
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION= %VALUE%/[ACCOUNT].[SKF_00352_CALC2],ACCOUNT="SKF_00352",FSGAAP="AC_SKF_00352")
*ENDWHEN

In REC there is no reason to provide not changed dimensions! COMMIT is useless!