on 10-08-2015 7:04 PM
Hi Can you guys help me how to reslove this error. Iam trying to create 6 months forecast logicscript. Just started with the first month and iam getting this error.LINE 11 syntax error: " missing name after .operator"
*XDIM_MEMBERSET CATEGORY = Forecast
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET PRODUCT_ALLOC = %PRODUCT_ALLOC_SET%
*XDIM_MEMBERSET RPTCURRENCY = LC
*XDIM_MEMBERSET TIME = %TIME_SET%
*SELECT(%ACCTSET%,"ID",ACCOUNT,"IS_ACCT_FC = 'Y'")
*FOR %ACCT% = %ACCTSET%
[ACCOUNT].[#%ACCT%] = 1/6 * (([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-1,%TIME_SET%)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-2,%TIME_SET%)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-3,%TIME_SET%)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-4,%TIME_SET%)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-5,%TIME_SET%)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-6,%TIME_SET%)]))
*NEXT
*COMMIT
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Easy! But looks that non of my answers are useful
*XDIM_MEMBERSET CATEGORY = Actual
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET PRODUCT_ALLOC = %PRODUCT_ALLOC_SET%
*XDIM_MEMBERSET RPTCURRENCY = LC
*SELECT(%ACCTSET%,[ID],ACCOUNT,"[IS_ACCT_FC] = 'Y'")
*XDIM_MEMBERSET ACCOUNT=%ACCTSET%
// Scope 6 previous months
*XDIM_MEMBERSET TIME = TMVL(-1,%TIME_SET%),TMVL(-2,%TIME_SET%),TMVL(-3,%TIME_SET%),TMVL(-4,%TIME_SET%),TMVL(-5,%TIME_SET%),TMVL(-6,%TIME_SET%)
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%/6,TIME=%TIME_SET%,CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(1,%TIME_SET%),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(2,%TIME_SET%),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(3,%TIME_SET%),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(4,%TIME_SET%),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(5,%TIME_SET%),CATEGORY=Forecast)
*ENDWHEN
Hi Vadim,
Some observations after executing Rolling forecast logic script.
ex.
2011.01 | 2011.02 | 2011.03 | 2011.04 | 2011.05 | 2011.06 | 2011.07 | 2011.08 | 2011.09 | 2011.1 | 2011.11 | 2011.12 |
Actual | Actual | Actual | Actual | Actual | Actual |
Current: If the user selects 2011.04 , it is caliculating the forecast for next 6 months but its taking the average of 6 months.(Eventhough user is selected only 3 months actuals)
Expected: If the user selects 2011.04 it should forecast for the next 6 moths based on the average of previous 4 months actual data.
Can you help me how to achieve this ?
Thanks in advance.
Sorry, but:
"Expected: If the user selects 2011.04 it should forecast for the next 6 moths based on the average of previous 4 months actual data." - Expected by whom? Is it possible to clearly explain the requirements from the very beginning? (by the way, to forecast next 6 months based on previous 6 months average looks more logical then to use months from the beginning of the year!)
Second: Is it absolutely bad idea to try to write the script yourself for the new requirements?
Hi Vadim,
Sorry for late response, Here is the my requirement, when the user selects date from the combbox, it has caliculate the 6 months rolling forecast based on the selected date.Here is the existing code...
//First Month
*XDIM_MEMBERSET CATEGORY = Forecast
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET PRODUCT_ALLOC = %PRODUCT_ALLOC_SET%
*XDIM_MEMBERSET RPTCURRENCY = LC
*XDIM_MEMBERSET TIME = $CURRMON$
*SELECT(%ACCTSET%,"ID",ACCOUNT,"IS_ACCT_FC = 'Y'")
*FOR %ACCT% = %ACCTSET%
[ACCOUNT].[#%ACCT%] = 1/12 * (([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-1,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-2,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-3,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-4,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-5,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-6,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-7,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-8,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-9,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-10,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-11,$CURRMON$)]) + ([ACCOUNT].[%ACCT%],[CATEGORY].[Actual],[TIME].[TMVL(-12,$CURRMON$)]))
*NEXT
*COMMIT
like this for next 5 months...
I have modified the suggested code you provided me like the below.Now iam getting invalid TMVL return value.Can you help me on this pls....
*XDIM_MEMBERSET CATEGORY = Actual
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET PRODUCT_ALLOC = %PRODUCT_ALLOC_SET%
*XDIM_MEMBERSET RPTCURRENCY = LC
*SELECT(%ACCTSET%,[ID],ACCOUNT,"[IS_ACCT_FC] = 'Y'")
*XDIM_MEMBERSET ACCOUNT=%ACCTSET%
// Scope 6 previous months
*XDIM_MEMBERSET TIME = TMVL(-1,$CURRMON$),TMVL(-2,$CURRMON$),TMVL(-3,$CURRMON$),TMVL(-4,$CURRMON$),TMVL(-5,$CURRMON$),TMVL(-6,$CURRMON$)
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%/6,TIME=$CURRMON$,CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(1,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(2,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(3,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(4,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,TIME=TMVL(5,$CURRMON$),CATEGORY=Forecast)
*ENDWHEN
Thanks in advance
Sorry, but unfortunately you still can't clearly explain you requirements
"Here is the my requirement, when the user selects date from the combbox, it has caliculate the 6 months rolling forecast based on the selected date." what do you mean "based on the selected date"???
Can you simply provide number of examples like:
If user selects 2011.01 I want to have ...
If user selects 2011.02 I want to have ...
If user selects 2011.03 I want to have ...
...
And any error you have can be discussed only with screenshot of UJKT!
Vadim
Hi Vadim,
This is the script iam using and the forecast month selected as 2011.07. please find the report as well.
//SIX MONTS RFC
*XDIM_MEMBERSET CATEGORY = Actual
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET PRODUCT_ALLOC = %PRODUCT_ALLOC_SET%
*XDIM_MEMBERSET RPTCURRENCY =USD
*SELECT(%ACCTSET%,[ID],ACCOUNT,"[IS_ACCT_FC] = 'Y'")
*XDIM_MEMBERSET ACCOUNT=%ACCTSET%
// Scope 6 previous months
*XDIM_MEMBERSET RFC_TIME = TMVL(-1,$CURRMON$),TMVL(-2,$CURRMON$),TMVL(-3,$CURRMON$),TMVL(-4,$CURRMON$),TMVL(-5,$CURRMON$),TMVL(-6,$CURRMON$)
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(1,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(2,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(3,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(4,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(5,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(6,$CURRMON$),CATEGORY=Forecast)
*ENDWHEN
Thanks in advance
Hi vadim,
Instead of account based rolling forecast , i would like to do the prodcut based rolling forecast. Can you guide me how to proceed further. I started modifying ur code as below. Why cant we create attribute like this... pls help me
*XDIM_MEMBERSET CATEGORY = Actual
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET PRODUCT_ALLOC=BAS(CPG_GRP27)
*XDIM_MEMBERSET RPTCURRENCY =USD
*SELECT(%PRODUCT_ALLOC_SET%,[ID],PRODUCT_ALLOC,"[IS_PRD_RC] = 'Y'")
// Scope 6 previous months
*XDIM_MEMBERSET RFC_TIME = TMVL(-1,$CURRMON$),TMVL(-2,$CURRMON$),TMVL(-3,$CURRMON$),TMVL(-4,$CURRMON$),TMVL(-5,$CURRMON$),TMVL(-6,$CURRMON$)
*WHEN PRODUCT_ALLOC
*IS *
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=$CURRMON$,CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(1,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(2,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(3,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(4,$CURRMON$),CATEGORY=Forecast)
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=TMVL(5,$CURRMON$),CATEGORY=Forecast)
*ENDWHEN
Incorrect line:
*SELECT(%PRODUCT_ALLOC_SET%,[ID],PRODUCT_ALLOC,"[IS_PRD_RC] = 'Y'")
%PRODUCT_ALLOC_SET% - is a reserved variable, you can't use it in SELECT.
And what do you want to do with PRODUCT_ALLOC dimension??? Not clear!
If you want to select PRODUCT_ALLOC members with IS_PRD_RC=Y then:
*SELECT(%PROD%,[ID],PRODUCT_ALLOC,"[IS_PRD_RC] = 'Y'")
*XDIM_MEMBERSET PRODUCT_ALLOC=%PROD%
Or???
Hi vadim,
Same error iam getting invalid attribure name IS_PRD_RC in Product dimension. My requirement is like this.
1. When the user selected productgroup it should perm rolling forecast based on the product group. One particular prodcut group contains bunch of products.
2. Not every productgroup will not involve in rolling forecast. Only specified productgroups can be rolling forecasted.
( thats the reason i created attribute IS_PRD_RC, if it is Y it is eligible for rolling forecast.
please find the product dimension below.
Thanks
Ups, you marked product parents with this property... it's another story!
*SELECT(%PRODPARENTS%,[ID],PRODUCT_ALLOC,IS_PRD_RC=Y)
*FOR %PROD%=%PRODPARENTS% //for each parent...
*XDIM_MEMBERSET PRODUCT_ALLOC=BAS(%PROD%)
*XDIM_MEMBERSET RFC_TIME = TMVL(-1,$CURRMON$),TMVL(-2,$CURRMON$),TMVL(-3,$CURRMON$),TMVL(-4,$CURRMON$),TMVL(-5,$CURRMON$),TMVL(-6,$CURRMON$)
*WHEN PRODUCT_ALLOC
*IS *
*REC(EXPRESSION=%VALUE%/6,RFC_TIME=$CURRMON$,CATEGORY=Forecast)
...
*NEXT
FOR/NEXT is slow, if you mark base members with IS_PRD_RC=Y then you will avoid FOR/NEXT
Vadim
Sorry, but I do not recommend using MDX syntax like in your code!
WHEN/ENDWHEN is dramatically faster!
You want to put 1/6 of sum of previous 6 months in the current month!
Then:
*XDIM_MEMBERSET CATEGORY = Actual
*XDIM_MEMBERSET ENTITY = %ENTITY_SET%
*XDIM_MEMBERSET PRODUCT_ALLOC = %PRODUCT_ALLOC_SET%
*XDIM_MEMBERSET RPTCURRENCY = LC
*SELECT(%ACCTSET%,[ID],ACCOUNT,"[IS_ACCT_FC] = 'Y'")
*XDIM_MEMBERSET ACCOUNT=%ACCTSET%
// Scope 6 previous months
*XDIM_MEMBERSET TIME = TMVL(-1,%TIME_SET%),TMVL(-2,%TIME_SET%),TMVL(-3,%TIME_SET%),TMVL(-4,%TIME_SET%),TMVL(-5,%TIME_SET%),TMVL(-6,%TIME_SET%)
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%/6,TIME=%TIME_SET%,CATEGORY=Forecast)
*ENDWHEN
Vadim
Message was edited by: Vadim Kalinin CATEGORY corrected
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
to test above the logicscript, iam using the datamanager package to run the script. but iam getting the package error. pls correct me if any thing is wrong.
PROMT(SELECTINPUT,,,,"%PRODUCT_ALLOC_DIM%,%ENTITY_DIM%,%RPTCURRENCY_DIM%")
PROMPT(COMBOBOX,%CURRMON%,"cHOOSE THE MONTH",0,2015.07,{2015.01,2015.02,2015.03,2015.04,2015.05,2015.06})INFO(%EQU%,=) INFO(%TAB%,;)
TASK(/CPMB/FX_RESTATMENT_LOGIC,SUSER,%USER%)
TASK(/CPMB/FX_RESTATMENT_LOGIC,SAPPSET,%APPSET%)
TASK(/CPMB/FX_RESTATMENT_LOGIC,SAPP,%APP%)
TASK(/CPMB/FX_RESTATMENT_LOGIC,SELECTION,%SELECTION%)
TASK(/CPMB/FX_RESTATMENT_LOGIC,REPLACEPARAM,CURRMON%EQU%%CURRMON%)
TASK(/CPMB/FX_RESTATMENT_LOGIC,LOGICFILENAME,6MONTHS_RFC.LGF
Thanks Vadim please please find the Debug results. Actually my intension to use combo box is user has the ability to select the the month to forecast.Can you guide me is there any way we can implement this,Thanks once again.
*XDIM_MEMBERSET CATEGORY = Actual
*XDIM_MEMBERSET ENTITY = CSO
*XDIM_MEMBERSET PRODUCT_ALLOC = SAP
*XDIM_MEMBERSET RPTCURRENCY = LC
*XDIM_MEMBERSET ACCOUNT=PL110,PL120,PL200,PL300,PL310,PL600,PL999
*XDIM_MEMBERSET TIME = 2011.02 , 2011.01 , 2010.12 , 2010.11 , 2010.10 , 2010.09
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION=%VALUE%/6,TIME=2011.03,CATEGORY=Forecast)
*ENDWHEN
-------------------------------------------------------------------------------------------------------------------------------------
LOG:
FILE:\ROOT\WEBFOLDERS\ENVIRONMENT830 \ADMINAPP\6MONTHS_RFC_MODEL\TEST.LGF
USER:HANAUSER830
APPSET:ENVIRONMENT830
APPLICATION:6MONTHS_RFC_MODEL
[INFO] GET_DIM_LIST(): I_APPL_ID="6MONTHS_RFC_MODEL", #dimensions=7
ACCOUNT,CATEGORY,ENTITY,MEASURES,PRODUCT_ALLOC,RPTCURRENCY,TIME
#dim_memberset=6
CATEGORY:Actual,1 in total.
ENTITY:CSO,1 in total.
PRODUCT_ALLOC:SAP,1 in total.
RPTCURRENCY:LC,1 in total.
ACCOUNT:PL110,PL120,PL200,PL300,PL310,...7 in total.
TIME:2010.09,2010.10,2010.11,2010.12,2011.01,...6 in total.
SCRIPT RUNNING TIME IN TOTAL:0.00 s.
COMBOBOX - you will have to manually adjust the list. And you have to pass parameter using different variable...
Why not:
PROMPT(SELECTINPUT,,,,"%PRODUCT_ALLOC_DIM%,%ENTITY_DIM%,%RPTCURRENCY_DIM%,%TIME_DIM%")
Then you will get the selected TIME member in %TIME_SET%
Also you have strange log - not working without error!
May be PRODUCT_ALLOC = SAP - is not a base member?
Vadim
Thank you very much sir, this is the first time iam using Debugger, Now i executed again with the base member PRODUCT_ALLOC=BW.updated test results: What actually we can expect even record count? Thanks for your quick response.
LOG BEGIN TIME:2015-09-18 20:06:20
FILE:\ROOT\WEBFOLDERS\ENVIRONMENT830 \ADMINAPP\6MONTHS_RFC_MODEL\TEST.LGF
USER:HANAUSER830
APPSET:ENVIRONMENT830
APPLICATION:6MONTHS_RFC_MODEL
[INFO] GET_DIM_LIST(): I_APPL_ID="6MONTHS_RFC_MODEL", #dimensions=7
ACCOUNT,CATEGORY,ENTITY,MEASURES,PRODUCT_ALLOC,RPTCURRENCY,TIME
#dim_memberset=6
CATEGORY:Actual,1 in total.
ENTITY:CSO,1 in total.
PRODUCT_ALLOC:BW,1 in total.
RPTCURRENCY:LC,1 in total.
ACCOUNT:PL110,PL120,PL200,PL300,PL310,...7 in total.
TIME:2010.09,2010.10,2010.11,2010.12,2011.01,...6 in total.
REC :%VALUE%/6
CALCULATION BEGIN:
QUERY PROCESSING DATA
QUERY TIME : 1.00 ms. 0 RECORDS QUERIED OUT.
QUERY REFERENCE DATA
CALCULATION TIME IN TOTAL :0.00 ms.
NO RECORDS GENERATED.
CALCULATION END.
ENDWHEN ACCUMULATION: 0 RECORDS ARE GENERATED.
SCRIPT RUNNING TIME IN TOTAL:1.00 s.
LOG END TIME:2015-09-18 20:06:20
Sorry, but the log:
#dim_memberset=6
CATEGORY:Actual,1 in total.
ENTITY:CSO,1 in total.
PRODUCT_ALLOC:BW,1 in total.
RPTCURRENCY:LC,1 in total.
ACCOUNT:PL110,PL120,PL200,PL300,PL310,...7 in total.
TIME:2010.09,2010.10,2010.11,2010.12,2011.01,...6 in total.
REC :%VALUE%/6
CALCULATION BEGIN:
QUERY PROCESSING DATA
QUERY TIME : 1.00 ms. 0 RECORDS QUERIED OUT.
Clearly states that there is no data in the model for this scope!!!
Vadim
User | Count |
---|---|
16 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.