Skip to Content

Script Logic: Sum issue

Hi,

I am trying ot develop a script which takes the balance of the last period of the last fiscal year for the following accounts:

i) Current Year Retained Earnings Account (CYRE) account (380003)

ii) Retained Earnings (RE) Account (380000)

and adds them to the balance of the Retained earnings account of the current period.

My script is as follows. The data through RSA1 for the RE and CYRE for the period 2014.12 is also attached below.

The script does not add CYRE balance and only adds RE balance of the last period of the last fiscal year to the RE balance in the current period.

Another question is that when I try to use the statement WHEN_REF_DATA = MASTER_DATA, I get the error use MAXMEMBERS. But even if I use MAXMEMBERS as shown in the code below, I still get the error "use MAXMEMBERS".

Please help me out with this.

Sincerely,

Nicky

*SELECT(%YR%,"[YEAR]",TIME,"[ID] = '%TIME_SET%'")

*SELECT(%COPYOPENING%,"[ID]",AUDITTRAIL,"[COPYOPENING] = 'Y'")

*XDIM_MEMBERSET TIME = TMVL(-12,%YR%.12)

*XDIM_MEMBERSET AUDITTRAIL = %COPYOPENING%

//*XDIM_MAXMEMBERS ENTITY = 50

//*WHEN_REF_DATA = MASTER_DATA

*WHEN ACCTLGL

*IS BAS("BS")

*WHEN ACCTLGL

*IS <> 380003

*WHEN ACCTLGL

*IS 380000

*REC(EXPRESSION = (%VALUE% + ([ACCTLGL].[380003],[AUDITTRAIL].[CALC_INPUT]) + [TIME].[TMVL(0,%TIME_SET%)]),ACCTLGL = 380000, TIME = %TIME_SET%)

*ENDWHEN

*ENDWHEN

*ENDWHEN

2014-12 RE.PNG (72.1 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Dec 11, 2014 at 08:00 AM

    Hi Nicky,

    The script is strange, let's define the requirements! Please read How To: Ask questions about Script Logic issues

    Scope to read data:

    ACCTLGL=380003 - base member?

    TIME=2014.12

    AUDITTRAIL=CALC_INPUT

    ACCTLGL=380000 - base member?

    TIME=2014.12

    AUDITTRAIL=%COPYOPENING% - how many members with [COPYOPENING] = 'Y'?

    ACCTLGL=380000

    TIME=2015.01 //or any period in the current year...

    AUDITTRAIL=%COPYOPENING%

    Target:

    ACCTLGL=380000

    TIME=2015.01 //or any period in the current year...

    AUDITTRAIL=%COPYOPENING%

    Vadim

    P.S. Never use RSA1 to show data, use report

    Add a comment
    10|10000 characters needed characters exceeded

    • OK!

      Then the script will be (for single target month in %TIME_SET%)

      *SELECT(%YR%,"[YEAR]",TIME,"[ID] = '%TIME_SET%'")

      *SELECT(%COPYOPENING%,"[ID]",AUDITTRAIL,"[COPYOPENING] = 'Y'")

      *XDIM_MEMBERSET TIME = %TIME_SET%,TMVL(-12,%YR%.12) //both months are scoped

      *XDIM_MEMBERSET AUDITTRAIL = %COPYOPENING%

      *XDIM_MEMBERSET ACCTLGL = 380003,380000 //both accounts are scoped

      *WHEN ACCTLGL

      *IS 380003

      *WHEN TIME

      *IS TMVL(-12,%YR%.12) //2014.12

      *REC(EXPRESSION=%VALUE%,TIME=%TIME_SET%,ACCOUNT=380000)

      *ENDWHEN

      *ELSE //380000

      *REC(EXPRESSION=%VALUE%,TIME=%TIME_SET%)

      *ENDWHEN

      Vadim

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.