cancel
Showing results for 
Search instead for 
Did you mean: 

Script Logic: Sum issue

nicky_hays
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi Nicky,

The script is strange, let's define the requirements! Please read

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

nicky_hays
Participant
0 Kudos

Yes Vadim, your assumptions are correct. 380000 and 380003 are both base members.

Lets assume that the current period is 2015.01 and the last period of the last fiscal year is 2014.12 then

380000 (2015.01) = 3800003 (2014.12) + 380000 (2014.12) + 380000 (2015.01) for all Audit trails which have COPYOPENING = "Y"

Sincerely,

Nicky

former_member186338
Active Contributor
0 Kudos

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

Answers (0)