cancel
Showing results for 
Search instead for 
Did you mean: 

BPC Script logic boolean condition

former_member221145
Participant
0 Kudos
264

Hi ,

I have written the below code in BPC script logic

Account Master Data

11204040 --> AST

11204040L --> LEQ

Requirement : 11204040 example has been taken into consideration for explaining the requirement:

When GL Account 11204040 has transaction data value less than 0 or negative balance then copy the balance of the account to Liability account 11204040L; else leave the balance in the account 11204040

*XDIM_MEMBERSET  ACCOUNT AS %ACCT_VAR% = BAS(ASSET)

*WHEN ACCOUNT.ACCTYPE
*IS AST
*REC(EXPRESSION = %VALUE% < 0 ? ACCOUNT = %ACCT_VAR%&"L" : ACCOUNT = %ACCT_VAR%, AUDITTRAIL = LOAD)
*ENDWHEN
*ENDWHEN
Validation of the logic script shows an error in the REC statement line : Unknown Dimension Name in Keyword: "11202000:
Thanks,Rohit

Accepted Solutions (0)

Answers (1)

Answers (1)

N1kh1l
Active Contributor
0 Kudos

rohit.padala

Ternary syntax is as below

A > B ? C : D

I would suggest you add a property in ACCOUNT dimension and maintain Liability Account ID's against Asset Accounts

Now try this below code. Please add relevant *XDIM_MEMBERSET for other dimensions. I think *XDIM_MEMBERSET AUDITTRAIL = should be there

*XDIM_MEMBERSET  ACCOUNT = BAS(ASSET)

*WHEN ACCOUNT
*IS *
*REC(EXPRESSION = %VALUE% < 0 ? %VALUE% : 0, ACCOUNT = ACCOUNT.LIABACCOUNT, AUDITTRAIL = LOAD)
*REC(EXPRESSION = %VALUE% > 0 ? %VALUE% : 0,AUDITTRAIL = LOAD)
*ENDWHEN

Please accept/upvote if this helps

Nikhil