on 12-07-2015 6:31 AM
Dear BPC expert,
I have questions on logic script. I am now using NW 10 version.
In source app, I have 1 dimension called DM1
In target app, I have 2 dimension called DM1, DM2
DM2 has same structure and member as in DM1
I would like to map this DM1 from source to DM1 and DM2 target.
I have tried to use ADD_DIM DM2=DM1:ID but caused internal error when saving data
Could you please help to solve the issue.
Many thanks
Geoffrey
Dear experts,
Here is logic script of InternalOrder, I tried to update maincube when saving InternalOrder data.
Maincube has dimension: SITE, SITE2, ACCOUNT, FLOW, AUDITTRAIL, CATEGORY, TIME, DEPT, BU, JV_BU, ENTITY
InternalOrder has dimension: SITE, ACCOUNT, FLOW, AUDITTRAIL, CATEGORY, TIME, DEPT, BU, JV_BU, ENTITY, IO, ANALYSIS1, ANALYSIS2
What I want is to put SITE values of InternalOrder to two identical dimensions: SITE & SITE2. The following scripts is workable but only can put NO_SITE values to SITE2 instead of using SITE values. Does anyone know how to work? Many thanks
*XDIM_ADDMEMBERSET AUDITTRAIL =
OPEX_Input,CAPEX_Input,MKT_Input,RENOV_Input
*DESTINATION_APP = MainCube
*SKIP_DIM = IO,ANLYCODE1,ANLYCODE2
*ADD_DIM FLOW = BEA, SITE2 = NO_SITE
*WHEN JVBU
*IS
"JV_BU"
*WHEN AUDITTRAIL
*IS
"OPEX_Input"
*REC( EXPRESSION =
%VALUE%)
*IS
"CAPEX_Input"
*WHEN ACCOUNT
*IS
"0000607000"
*REC(EXPRESSION = %VALUE%)
*ENDWHEN
*IS
"MKT_Input"
*REC( EXPRESSION =
%VALUE%)
*IS
"RENOV_Input"
*WHEN ACCOUNT
*IS
"0000607000"
*REC(EXPRESSION =
%VALUE%)
*ENDWHEN
*ENDWHEN
*IS
"NO_JV"
*WHEN AUDITTRAIL
*IS
"OPEX_Input"
*REC( EXPRESSION =
%VALUE%)
*IS
"CAPEX_Input"
*WHEN ACCOUNT
*IS
"0000607000"
*REC(EXPRESSION =
%VALUE%)
*ENDWHEN
*IS
"MKT_Input"
*REC( EXPRESSION =
%VALUE%)
*IS
"RENOV_Input"
*WHEN ACCOUNT
*IS
"0000607000"
*REC(EXPRESSION =
%VALUE%)
*ENDWHEN
*ENDWHEN
*ENDWHEN
*START_BADI ZUJ_IO
QUERY = ON
WRITE = ON
*END_BADI
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Geoffrey,
I see some mismatch between:
Maincube has dimension: SITE, SITE2, ACCOUNT, FLOW, AUDITTRAIL, CATEGORY, TIME, DEPT, BU, JV_BU, ENTITY
InternalOrder has dimension: SITE, ACCOUNT, FLOW, AUDITTRAIL, CATEGORY, TIME, DEPT, BU, JV_BU, ENTITY, IO, ANALYSIS1, ANALYSIS2
And
*DESTINATION_APP = MainCube
*SKIP_DIM = IO,ANLYCODE1,ANLYCODE2
*ADD_DIM FLOW = BEA, SITE2 = NO_SITE
Strange in bold!
Also in the first post you wrote that it was tested:
*ADD_DIM ... SITE2=SITE:ID
Can you show UJKT log of minimal script:
*XDIM_MEMBERSET AUDITTRAIL = OPEX_Input
*XDIM_MEMBERSET JVBU
//may be some extra XDIM_MEMBERSET to narrow the scope
*DESTINATION_APP = MainCube
*SKIP_DIM = IO,ANLYCODE1,ANLYCODE2
*ADD_DIM FLOW = BEA, SITE2 = SITE:ID // not sure about FLOW?
*WHEN JVBU
*IS *
*REC(EXPRESSION=%VALUE%)
*ENDWHEN
You can also try RENAME_DIM like:
*XDIM_MEMBERSET AUDITTRAIL = OPEX_Input
*XDIM_MEMBERSET JVBU
*DESTINATION_APP = MainCube
*SKIP_DIM = ANLYCODE1,ANLYCODE2 //No IO SKIP
*ADD_DIM FLOW = BEA // not sure about FLOW?
*RENAME_DIM IO=SITE2
*WHEN JVBU
*IS *
*REC(EXPRESSION=%VALUE%,IO=SITE.ID)
*ENDWHEN
Vadim
P.S. Please paste the code in more readable form!
Just tested!
Dump with *ADD_DIM TITLES2=TITLES:ID
Working with *RENAME_DIM:
LGX:
*XDIM_MEMBERSET TITLES=1100,1110
*XDIM_MEMBERSET PERIODS=2011.JAN
*XDIM_MEMBERSET PLANTYPE=ACTUAL
*XDIM_MEMBERSET BE=BE1000
*XDIM_MEMBERSET ADV=PAGESD
*DESTINATION_APP=ALLOCBASE
*ADD_DIM ALLOCBASEACCT=BASESPLIT1,MVZ=10217
*RENAME_DIM ADV=TITLES2
*WHEN ADV
*IS *
*REC(EXPRESSION=%VALUE%,ADV=TITLES.ID)
*ENDWHEN
-------------------------------------------------------------------------------------------------------------------------------------
LOG:
LOG BEGIN TIME:2015-12-17 15:24:50
FILE:\ROOT\WEBFOLDERS\SIM \ADMINAPP\ADVSALES\TEST.LGF
USER:V.KALININ
APPSET:SIM
APPLICATION:ADVSALES
[INFO] GET_DIM_LIST(): I_APPL_ID="ADVSALES", #dimensions=6
ADV,BE,MEASURES,PERIODS,PLANTYPE,TITLES
#dim_memberset=5
TITLES:1100,1110,2 in total.
PERIODS:2011.JAN,1 in total.
PLANTYPE:ACTUAL,1 in total.
BE:BE1000,1 in total.
ADV:PAGESD,1 in total.
REC :%VALUE%
CALCULATION BEGIN:
QUERY PROCESSING DATA
QUERY TIME : 5.00 ms. 2 RECORDS QUERIED OUT.
QUERY REFERENCE DATA
CALCULATION TIME IN TOTAL :0.00 ms.
2 RECORDS ARE GENERATED.
CALCULATION END.
ENDWHEN ACCUMULATION: 2 RECORDS ARE GENERATED.
DATA TO WRITE BACK:
ALLOCBASEACCT BE MVZ PERIODS PLANTYPE TITLES TITLES2 SIGNEDDATA
BASESPLIT1 BE1000 10217 2011.JAN ACTUAL 1100 1100 - 5.80
BASESPLIT1 BE1000 10217 2011.JAN ACTUAL 1110 1110 - 64.00
2 RECORDS HAVE BEEN WRITTEN BACK.
WRITING TIME :25.00 ms.
SCRIPT RUNNING TIME IN TOTAL:31.00 s.
LOG END TIME:2015-12-17 15:25:21
And your final code will be:
*XDIM_MEMBERSET AUDITTRAIL = OPEX_Input,CAPEX_Input,MKT_Input,RENOV_Input
*XDIM_MEMBERSET JVBU=JV_BU,NO_JV
*DESTINATION_APP = MainCube
*SKIP_DIM = ANLYCODE1,ANLYCODE2
*ADD_DIM FLOW = BEA
*RENAME_DIM IO=SITE2
*WHEN AUDITTRAIL
*IS OPEX_Input,MKT_Input
*REC(EXPRESSION=%VALUE%,IO=SITE.ID)
*IS CAPEX_Input,RENOV_Input
*WHEN ACCOUNT
*IS "0000607000"
*REC(EXPRESSION=%VALUE%,IO=SITE.ID)
*ENDWHEN
*ENDWHEN
Dear Vadim,
Thank you so much for your help.
I will try and see if it works for me.
BTW, I would like to ask you about the logic script update logic.
e.g.
InternalOrder cube update as follows
IO ACCOUNT SITE ANLYCODE1 ANLYCODE2 BU JV ENTITY AUDITTRAIL CATEGORY TIME SIGNEDAMT
A 100 NY AN1 AN2 BU1 JV1 1000 OPEX_INPUT PLAN1 2015.01 300
The original logic script will update as follows
MAINCUBE
ACCOUNT SITE ANLYCODE1 ANLYCODE2 BU JV ENTITY AUDITTRAIL CATEGORY TIME FLOW SIGNEDAMT
100 NY AN1 AN2 BU1 JV1 1000 OPEX_INPUT PLAN1 2015.01 BEA 300
After that, I add another 2 entries
InternalOrder cube update as follows
IO ACCOUNT SITE ANLYCODE1 ANLYCODE2 BU JV ENTITY AUDITTRAIL CATEGORY TIME SIGNEDAMT
B 100 NY AN1 AN2 BU1 JV1 1000 OPEX_INPUT PLAN1 2015.01 1000
C 100 NY AN1 AN2 BU1 JV1 1000 OPEX_INPUT PLAN1 2015.01 5000
The original logic script will update as follows
MAINCUBE
ACCOUNT SITE ANLYCODE1 ANLYCODE2 BU JV ENTITY AUDITTRAIL CATEGORY TIME FLOW SIGNEDAMT
100 NY AN1 AN2 BU1 JV1 1000 OPEX_INPUT PLAN1 2015.01 BEA 5700
It seems like it will ignore IO=A entry when executing logic script of InternalOrder. The system seems to consider amt=6000 (IO=B or C) is final amount.
Do you have any solution for this?
Many many thanks in advance
Geoffrey
Dear Vadim,
I have retested using UJKT. The result is different. It seems like the original logic script will consider the whole amount i.e. IO=A+B+C instead of B+C.
The problem I have now is that I put this as default logic script to run. Will there be any difference when I use UJKT to run or put as default logic script?
Please advise.
Geoffrey
The default logic is absolutely different - incoming scope is coming from changed members! Please read
Also there is different sign logic with default.lgf
My script will work correctly if you run it in UJKT or DM package with properly defined scope in the beginning of the script.
I do not recommend you to put this script in default.lgf or you have to completely rewrite it.
Vadim
P.S. For IO to calculate correctly you have to scope IO to all members in DM or use parent IO in default.lgf. *XDIM_MEMBERSET IO=<ALL>
I still see some mismatches in your previous post:
Why: *SKIP_DIM = ANLYCODE1,ANLYCODE2
If:
MAINCUBE
ACCOUNT SITE ANLYCODE1 ANLYCODE2
???
Can you accurately provide real list of dimensions?
Vadim
Sorry Vadim,
Correct DIMENSION as follows:
InternalOrder Model:
IO ACCOUNT SITE ANLYCODE1 ANLYCODE2 BU JVBU ENTITY AUDITTRAIL CATEGORY TIME INPUTCURRENCY MEASURES
MainCube Model:
ACCOUNT SITE SITE2 BU JVBU ENTITY AUDITTRAIL CATEGORY TIME INPUTCURRENCY MEASURES FLOW
I Tried your code but system said invalid dimension mapping of destination MaiCube
*XDIM_MEMBERSET IO = <ALL>
*XDIM_MEMBERSET ANLYCODE1 = <ALL>
*XDIM_MEMBERSET ANLYCODE2 = <ALL>
*XDIM_MEMBERSET AUDITTRAIL = OPEX_Input,CAPEX_Input,MKT_Input,RENOV_Input
*XDIM_MEMBERSET JVBU=JV_BU,NO_JV
*DESTINATION_APP = MainCube
*SKIP_DIM = IO,ANLYCODE1,ANLYCODE2
*ADD_DIM FLOW = BEA
*RENAME_DIM SITE=SITE2
*WHEN AUDITTRAIL
*IS OPEX_Input,MKT_Input
*REC(EXPRESSION=%VALUE%,SITE=SITE.ID)
*IS CAPEX_Input,RENOV_Input
*WHEN ACCOUNT
*IS "0000607000"
*REC(EXPRESSION=%VALUE%,SITE=SITE.ID)
*ENDWHEN
*ENDWHEN
Do you have any idea?
P.S. Script sample to be used for default.lgf:
*XDIM_MEMBERSET IO = <ALL> //To aggregate all IO
*XDIM_MEMBERSET ANLYCODE1 = <ALL> //To aggregate all ANLYCODE1
*XDIM_MEMBERSET ANLYCODE2 = <ALL> //To aggregate all ANLYCODE2
*DESTINATION_APP = MainCube
*SKIP_DIM = ANLYCODE1,ANLYCODE2
*ADD_DIM FLOW = BEA
*RENAME_DIM IO=SITE2 //will not affect IO scope
*WHEN JVBV
*IS JV_BU,NO_JV
*WHEN AUDITTRAIL
*IS OPEX_Input,MKT_Input
*WHEN ACCOUNT.ACCTYPE
*IS INC,LEQ
*REC(EXPRESSION=-%VALUE%,IO=SITE.ID) //Sign inversion required for INC,LEQ accounts
*ELSE
*REC(EXPRESSION=%VALUE%,IO=SITE.ID) //No invertion for EXP,AST accounts
*ENDWHEN
*IS CAPEX_Input,RENOV_Input
*WHEN ACCOUNT
*IS "0000607000"
*REC(EXPRESSION=%VALUE%,IO=SITE.ID) //If ACCOUNT 0000607000 is INC or LEQ add "-" before %VALUE%
*ENDWHEN
*ENDWHEN
*ENDWHEN
Vadim
P.S. I can see some badi at the end of your original script. To correctly process this badi you need to restore original scope for scoped dimensions before the badi call like:
*XDIM_MEMBERSET IO = %IO_SET%
*XDIM_MEMBERSET ANLYCODE1 = %ANLYCODE1_SET%
*XDIM_MEMBERSET ANLYCODE2 = %ANLYCODE2_SET%
...
Dear Vadim,
I would like to ask why IO=SITE.ID?
My case is that source cube: InternalOrder has 1 dimension called SITE and target cube: MainCube has 2 dimension SITE, SITE2 where SITE2 has same member as SITE. What it want is to use SITE values in InternalOrder to save as SITE & SITE2 in MainCube.
IO is actually a different dimension in source cube.
Please advise
Regards
Geoffrey
Hi Geoffrey,
Do you have SKIP_DIM DM1 in your script or do you want keeping it?
-Gersh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
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.