Hello.
My system is BPC 10 NW,
I'm trying to do a Script to achieve the next logic:
I have two Models (Contracts & Planning). Contracts has the next data
ACCOUNT_RS | TIME | SIGNED_DATA |
---|---|---|
PRICEM2 | 2014.UNITS | 200 |
PRICEM2 | 2013.UNITS | 150 |
PRICEM2 | .... | .... |
The other model (Planning) has the next data
ACCOUNT_RS | TIME | SIGNED_DATA |
---|---|---|
PERCENTAGEARENT | 2014.JAN | 0,5 |
PERCENTAGEARENT | 2014.FEB | 0,7 |
PERCENTAGEARENT | ... | .... |
PERCENTAGEARENT | 2013.JAN | 0,6 |
PERCENTAGEARENT | 2013.FEB | 0,9 |
PERCENTAGEARENT | .... | .... |
And the result (in model Planning) I am looking forward is:
ACCOUNT_RS | TIME | SIGNED_DATA |
---|---|---|
PERCENTAGEARENT | 2014.JAN | 0,5 |
PERCENTAGEARENT | 2014.FEB | 0,7 |
PERCENTAGEARENT | .... | .... |
PERCENTAGEARENT | 2013.JAN | 0,6 |
PERCENTAGEARENT | 2013.FEB | 0,9 |
PERCENTAGEARENT | .... | .... |
PRICEM2 | 2014.JAN | 200 |
PRICEM2 | 2014.FEB | 200 |
PRICEM2 | ... | |
PRICEM2 | 2013.JAN | 150 |
PRICEM2 | 2013.FEB | 150 |
The Script that I developed is the next but I get Syntax error in the line of *REC
//JAN, FEB ...
*SELECT(%MON_SEL%,MONTHNUM,TIME,LEVEL= MONTH)
//2014, 2015...
*SELECT(%YEA_SEL%,YEAR,TIME,LEVEL = YEAR)
*LOOKUP Contracts
*FOR %YEA_ACT% = %YEA_SEL%
*FOR %MON_ACT% = %MON_SEL%
//TIM_2014.JAN, TIM_2014.FEB
*DIM TIM_%YEA_ACT%.%MON_ACT%:TIME = %YEA_ACT%
//ACS_2014.JAN, ACS_2014.FEB
*DIM ACS_%YEA_ACT%.%MON_ACT%:ACCOUNT_RS = PRICEM2
*NEXT
*NEXT
*ENDLOOKUP
*WHEN ACCOUNT_RS
*IS PERCENTAGEARENT
*FOR %YEA_ACT% = %YEA_SEL%
*FOR %MON_ACT% = %MON_SEL%
*WHEN TIME
*IS %YEA_ACT%.%MON_ACT%
//2014.JAN ..
*REC(EXPRESION = LOKKUP(ACS_%YEA_ACT%.%MON_ACT%), ACCOUNT_RS = PRICEM2)
*ENDWHEN
*NEXT
*NEXT
*ENDWHEN