on 2016 Aug 22 7:39 AM
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
Request clarification before answering.
Sorry, but the code is not attached!
Why you can't copy paste??? Try another browser!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
%RETYEAR% is a variable which will pick the year from the parameter passed. For eg - if we are passing 2015.Y in data manager package, then using below select statement, it picks up 2015 as its value.
*SELECT(%RETYEAR%, [YEAR], CHEM_TIME, [ID] = 2015.Y
The select statement has got missed in the code I have attached. Sorry!
Look on this code:
*XDIM_MEMBERSET CHEM_TIME = 2014.Y,2015.01
*WHEN CHEM_TIME
*IS 2014.Y
*WHEN CHEM_LINE
*IS PD3900X
*REC(EXPRESSION=%VALUE%,CHEM_TIME=2015.01)
*ENDWHEN
*IS 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
THanks Vadim. I have rewritten the code as below. *FOR %TIME3% = %MTH% *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 The above loop runs from Jan 2015 to Dec 2015. But I think the calculation is not happening as expeted. I wanted 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 But, the calculation is happening as PD3900X of 2015.01= PD3900X of 2014.Y+ P11000X of 2014.Y - CFH_CG1100 of 2014.Y - ZA1200X of 2014.Y + P90001 of 2014.Y
Vadim, First of all, I want to thank you a lot for your time and all the efforts.
Basically I am trying for carry forward of numbers for the whole year based on below steps:
In the data manager package, user selects 2015.Y in case of above example.
Let me know if case you need more information
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
| User | Count |
|---|---|
| 14 | |
| 8 | |
| 7 | |
| 6 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.