Skip to Content
author's profile photo Former Member
Former Member

Script logic calcuation

Hi,

I want to calculate PD3900X of 2015.01= PD3900X of 2014.Y+ P11000X of 2015.01 - CFH_CG1100 of 2015.01 - ZA1200X of 2015.01 + P90001 of 2015.01

All the above are accounts. THis calculation is to be triggered by a data manager package.

I have written the below code - cannot copy paste the code. Hence attached the code in txt format.

Please note that all the nodes are leaf nodes except CFH_CG1100 node. CFH_CG1100 is a parent node which has a set of children under it.

My first set of code, which is first when loop executes fine.

The part of code which I have written when PD3900X of 2014.Y is blank - is giving problem. It is calculating multiple times. The answer I am getting is 4 times the expected answer.

I understand that when the "when loop" closes, the answers should be over written. But they are not!! Any suggestions are welcomed.

Thanks,

Swetha

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Aug 22, 2016 at 07:11 AM

    Sorry, but the code is not attached!

    Why you can't copy paste??? Try another browser!

    Add a comment
    10|10000 characters needed characters exceeded

    • Sample code:

      *XDIM_MEMBERSET CHEM_TIME AS %T_VAR1% = 2015.01

      *XDIM_MEMBERSET CHEM_TIME AS %TIME1% = 2014.Y

      *XDIM_MEMBERSET CHEM_TIME AS %MTH% = 2015.01, 2015.02, 2015.03, 2015.04, 2015.05, 2015.06, 2015.07, 2015.08, 2015.09, 2015.10, 2015.11

      //The BELOW code is to copy from 2014.Y TO 2015.01

      *XDIM_MEMBERSET CHEM_TIME = %TIME1%,%T_VAR1%

      *WHEN CHEM_TIME

      *IS %TIME1% //2014.Y

      *WHEN CHEM_LINE

      *IS PD3900X

      *REC(EXPRESSION=%VALUE%,CHEM_TIME=%T_VAR1%)

      *ENDWHEN

      *IS %T_VAR1% //2015.01

      *WHEN CHEM_LINE

      *IS P11000X

      *REC(EXPRESSION =%VALUE%, CHEM_LINE=PD3900X)

      *IS BAS(CFH_CG1100)

      *REC(EXPRESSION=-%VALUE%,CHEM_LINE=PD3900X)

      *IS ZA1200X

      *REC(EXPRESSION=-%VALUE%,CHEM_LINE=PD3900X)

      *IS P90001

      *REC(EXPRESSION=%VALUE%,CHEM_LINE=PD3900X)

      *ENDWHEN

      *ENDWHEN

      //The BELOW code is to copy from 2015.01 TO 2015.02, 2015.02 TO 2015.03....................2015.11 TO 2015.12

      *FOR %TIME3% = %MTH% //2015.01-2015.11!!!

      *XDIM_MEMBERSET CHEM_TIME = %TIME3%,TMVL(1,%TIME3%)

      *WHEN CHEM_TIME

      *IS %TIME3%

      *WHEN CHEM_LINE

      *IS PD3900X

      *REC(EXPRESSION=%VALUE%,CHEM_TIME=TMVL(1,%TIME3%))

      *ENDWHEN

      *IS TMVL(1,%TIME3%)

      *WHEN CHEM_LINE

      *IS P11000X

      *REC(EXPRESSION=%VALUE%,CHEM_LINE=PD3900X)

      *IS BAS(CFH_CG1100)

      *REC(EXPRESSION=-%VALUE%,CHEM_LINE=PD3900X)

      *IS ZA1200X

      *REC(EXPRESSION=-%VALUE%,CHEM_LINE=PD3900X)

      *IS P90001

      *REC(EXPRESSION=%VALUE%,CHEM_LINE=PD3900X)

      *ENDWHEN

      *ENDWHEN

      *NEXT

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.