on 09-06-2016 3:52 PM
Hi,
I have a piece of transfer logic between a YTD and a periodic model and I am then running a second script in the destination using RUNLOGIC_PH. This is working successfully
What I am now trying to do is to either pass a variable or create a variable in the second but of logic based on the selection made in the data manager package. Ideally this variable would be created by a *SELECT statement either in the first transfer logic or the second bit of logic.
The scenario is that I have a Monthly Model with a monthly time dimension transferring data to a Weekly model with a weekly time dimension. So I am taking a month (base level in monthly time dimension) and wanting to post it to the last week in the month in the weekly model which has weeks as a base level.
In the DM package - a month is selected, there is a property in the monthly time dimension called LAST_WEEK. I need to be able to pass the LAST_WEEK variable to the second bit of logic so I can use it in the REC statement.
// SCOPING
*XDIM_MEMBERSET ACCOUNT = BAS(P-190-000-000)
*XDIM_MEMBERSET ACCOUNT_DETAIL = BAS(T_DEPARTM)
*XDIM_MEMBERSET AUDITTRAIL = INPUT,ERP//BAS(Inp_ERP)
*XDIM_MEMBERSET CURRENCY = LC,GBP
*XDIM_MEMBERSET ENTITY_MONTHLY = %ENTITY_MONTHLY_SET%
*XDIM_MEMBERSET EXPENSE_TYPE = <ALL>
*XDIM_MEMBERSET INTERCO = <ALL>
*XDIM_MEMBERSET TIME_MONTHLY = %TIME_MONTHLY_SET%
*XDIM_MEMBERSET VERSION = ACTUAL
// DESTINATION
*DESTINATION_APP = WEEKLY
*RENAME_DIM ENTITY_MONTHLY = ENTITY_WEEKLY
*RENAME_DIM TIME_MONTHLY = TIME_WEEKLY
// CALCULATION
*WHEN TIME_MONTHLY.PERIOD
*IS M01
*REC(EXPRESSION = %VALUE%, AUDITTRAIL=MONTHLY,TIME_MONTHLY=TIME_MONTHLY.LAST_WEEK)
*ELSE
*REC(EXPRESSION = [TIME_MONTHLY].[%TIME_MONTHLY_SET%]-[TIME_MONTHLY].[TMVL(-1,%TIME_MONTHLY_SET%)], AUDITTRAIL=MONTHLY,TIME_MONTHLY=TIME_MONTHLY.LAST_WEEK)
*ENDWHEN
// SEND TO THE DATABASE
*COMMIT
// Runs the Monthly Adjustment script in the Weekly model
*START_BADI RUNLOGIC_PH
QUERY=OFF
WRITE=ON
VALIDATION = OFF
LOGIC = MONTHLY_ADJUSTMENT.LGF
APP = WEEKLY
APPSET = GROUPBPC
// Dimension only exist in source
DIMENSION TIME_MONTHLY = <NONE>
DIMENSION ENTITY_MONTHLY = <NONE>
// Dimension only exist in destination
DIMENSION TIME_WEEKLY = BAS(%TIME_MONTHLY_SET%)
DIMENSION ENTITY_WEEKLY = %ENTITY_MONTHLY_SET%
// Dimension that exist in both
*END_BADI
Not very clear, but
You have MONTHLY model with the script with RUNLOGIC_PH
RUNLOGIC_PH will run script in WEEKLY model.
Please show the script in WEEKLY model!
P.S. %TIME_MONTHLY_SET% can be single month or multiple months?
Anyway you can:
*SELECT(%W%,[LAST_WEEK],TIME_MONTHLY,[ID]=%TIME_MONTHLY_SET%)
...
DIMENSION TIME_WEEKLY=%W%
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
My scope on the runlogic is correct in that I am want to scope all of the weeks within the month so your recommendation of the selection statement doesn't work because the problem is that in my rec statement I only want to send data to the last week of the month.
Here is the logic in the Weekly model:
//*SELECT (%LAST_WEEK%, "[ID]", "TIME_WEEKLY", "[MONTH_ID]='LAST_WEEK'")
// SCOPING
*XDIM_MEMBERSET ACCOUNT = BAS(P-190-000-000)
*XDIM_MEMBERSET ACCOUNT_DETAIL = BAS(T_DEPARTM)
*XDIM_MEMBERSET AUDITTRAIL = ADJ_W2M
*XDIM_MEMBERSET CURRENCY = LC,GBP
//*XDIM_MEMBERSET ENTITY_WEEKLY = %ENTITY_WEEKLY_SET%
*XDIM_MEMBERSET EXPENSE_TYPE = <ALL>
*XDIM_MEMBERSET INTERCO = <ALL>
//*XDIM_MEMBERSET TIME_WEEKLY = %TIME_WEEKLY_SET%
*XDIM_MEMBERSET VERSION = ACTUAL
// CALCULATION
*WHEN AUDITTRAIL
*IS ADJ_W2M
*REC(FACTOR=0)
*ENDWHEN
// SCOPING
*XDIM_MEMBERSET ACCOUNT = BAS(P-190-000-000)
*XDIM_MEMBERSET ACCOUNT_DETAIL = BAS(T_DEPARTM)
*XDIM_MEMBERSET AUDITTRAIL = ERP, INPUT
*XDIM_MEMBERSET CURRENCY = LC,GBP
//*XDIM_MEMBERSET ENTITY_WEEKLY = %ENTITY_WEEKLY_SET%
*XDIM_MEMBERSET EXPENSE_TYPE = <ALL>
*XDIM_MEMBERSET INTERCO = <ALL>
//*XDIM_MEMBERSET TIME_WEEKLY = 2016.W05,2016.W06,2016.W07,2016.W08
*XDIM_MEMBERSET VERSION = ACTUAL
// CALCULATION
*WHEN AUDITTRAIL
*IS ERP,INPUT
*REC(FACTOR=1, AUDITTRAIL=ADJUSTMENT,TIME_WEEKLY=%LAST_WEEK%)
*ENDWHEN
*XDIM_MEMBERSET ACCOUNT = BAS(P-190-000-000)
*XDIM_MEMBERSET ACCOUNT_DETAIL = BAS(T_DEPARTM)
*XDIM_MEMBERSET AUDITTRAIL = ERP, INPUT
*XDIM_MEMBERSET CURRENCY = LC,GBP
//*XDIM_MEMBERSET ENTITY_WEEKLY = %ENTITY_WEEKLY_SET%
*XDIM_MEMBERSET EXPENSE_TYPE = <ALL>
*XDIM_MEMBERSET INTERCO = <ALL>
//*XDIM_MEMBERSET TIME_WEEKLY = 2016.W05,2016.W06,2016.W07,2016.W08
*XDIM_MEMBERSET VERSION = ACTUAL
// CALCULATION
*WHEN ACCOUNT
*IS *
*REC(EXPRESSION = [AUDITTRAIL].[MONTHLY]-[AUDITTRAIL].[ADJUSTMENT], AUDITTRAIL=ADJ_W2M, TIME_WEEKLY=%LAST_WEEK%)
*ENDWHEN
I have created a select statement the same as you recommended before posting this discussion and then used the variable in the rec statement in the weekly model and I get warning on the package and no records are posted because it has not populated the variable.
Any help would be appreciated.
OK, the solution is to pass Month member:
DIMENSION TIME_WEEKLY = %TIME_MONTHLY_SET% //2015.M03
Then in the WEEKLY script (%TIME_WEEKLY_SET%=2015.M03):
*SELECT(%LASTWEEK%,LAST_WEEK,TIME_MONTHLY,ID=%TIME_WEEKLY_SET%)
//%LASTWEEK%=2015.W...
*XDIM_MEMBERSET ADV=BAS(%TIME_WEEKLY_SET%) //scope to weeks in the month
User | Count |
---|---|
13 | |
2 | |
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.