Skip to Content
avatar image
Former Member

Conditional *REC statement based on Value in Other Account

Dear Experts,

I am trying the below mentioned Script logic but its not working as required.

*XDIM_MEMBERSET CATEGORY = ACTUAL
*XDIM_MEMBERSET RPTCURRENCY = INR
*XDIM_MEMBERSET TIME = %TIME_SET%
*XDIM_MEMBERSET FLOW = F_999
*XDIM_MEMBERSET SCOPE = %SCOPE_SET%
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET AUDITTRAIL = AJ_SHARE,INPUT_GW, AJ_CAPIN
*XDIM_MEMBERSET ACCOUNT = ELIM_GW, LC_GW

*WHEN ACCOUNT 
*IS ELIM_GW
*WHEN AUDITTRAIL
*IS AJ_SHARE
*REC(EXPRESSION = [ACCOUNT].[LC_GW];[AUDITRAIL].[INPUT_GW]==0 ? %VALUE%:0, 
AUDITTRAIL= AJ_CAPIN, ACCOUNT = ELIM_GW)
*ELSE
*ENDWHEN
*COMMIT

Basically, What I need the script to do is analyse each entity to see if the value in combination of Account: LC_GW and AUDITTRAIL: INPUT_GW is "0" then Write back the Value in combination of Account: ELIM_GW and Audittrail:AJ_SHARE to Combination of Audittrail:AJ_CAPIN and Account:ELIM_GW or if the Value in combination of Account: LC_GW and AUDITTRAIL: INPUT_GW is not "0" then Write back "0" to Combination of Audittrail:AJ_CAPIN and Account:ELIM_GW.

Is there any correction required in the Script?

Thanks,

Collin Mendoza.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jul 28, 2017 at 08:07 AM

    Syntax of tuple is incorrect here:

    *REC(EXPRESSION = [ACCOUNT].[LC_GW];[AUDITRAIL].[INPUT_GW]==0 ? %VALUE%:0, 
    AUDITTRAIL= AJ_CAPIN, ACCOUNT = ELIM_GW)

    Have to be:

    *REC(EXPRESSION = ([ACCOUNT].[LC_GW],[AUDITRAIL].[INPUT_GW])==0 ? %VALUE%:0, 
    AUDITTRAIL= AJ_CAPIN, ACCOUNT = ELIM_GW)
    Add comment
    10|10000 characters needed characters exceeded

  • Jul 28, 2017 at 08:12 AM
    -1

    Some other small issues, the code has to be:

    *XDIM_MEMBERSET AUDITTRAIL = AJ_SHARE // don't scope not used!
    *XDIM_MEMBERSET ACCOUNT = ELIM_GW  // don't scope not used!
    *WHEN ACCOUNT 
    *IS *
    *REC(EXPRESSION = ([ACCOUNT].[LC_GW],[AUDITRAIL].[INPUT_GW])==0 ? %VALUE%:0, 
    AUDITTRAIL= AJ_CAPIN, ACCOUNT = ELIM_GW)
    *ENDWHEN

    And don't use useless COMMIT!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 28, 2017 at 12:36 PM

    Dear Vadim,

    I made the below change to the Script now it is working as required.

    *XDIM_MEMBERSET CATEGORY = ACTUAL
    *XDIM_MEMBERSET RPTCURRENCY = INR
    *XDIM_MEMBERSET TIME = 2016.MAR
    *XDIM_MEMBERSET FLOW = F_999
    *XDIM_MEMBERSET SCOPE = C_SCOPE
    *XDIM_MEMBERSET ENTITY = 8000,8100
    *XDIM_MEMBERSET AUDITTRAIL = AJ_SHARE
    *XDIM_MEMBERSET ACCOUNT = ELIM_GW
    
    *WHEN ACCOUNT 
    *IS *
    *REC(EXPRESSION =([ACCOUNT].[LC_GW],[AUDITTRAIL].[INPUT_GW],[INTERCO].[ALL_TOT],[TRANSCURRENCY].[ALL_TR],[INTERSEG].[TOT],[SEGMENT].[S_TOT])==0 ? %VALUE%:0, AUDITTRAIL= AJ_CAPIN, ACCOUNT = ELIM_GW)
    *ENDWHEN
    
    

    Thanks for the help. :)

    Collin.

    Add comment
    10|10000 characters needed characters exceeded