on ‎2017 Feb 09 11:38 AM
Hi experts ,
I'm facing a problem.
I Have 3 models
Calendar :DAY (Time dimension),Workcenter,Version
Production: TIME,Workcenter,Version,TV_Production, Production_order
Daily_production:DAY,Workcenter,Version,TV_Production, Production_order
what i want to do :
I have the calendar wich is inputed everday by workcenter, and I have a monthly quantity of production wich is by workcenter and production order .
I sent both value to the third model .
and I want to do a split to have a daily production quantity based on the calendar.
the Day dimention :

the Time dimension:

so for the calendar i'm sending values to daily production with prodction_order=NON_APPLICABLE
and for quantity i'm sending values to daily production to for example 2016.01.IMP so I can do an allocation .
my scripts:
copy of calendar to daily production
*DESTINATION_APP =
Daily_production
*ADD_DIM TV_PRODUCTION=CAL
*ADD_DIM ORDRE_FAB=NA
*WHEN DAY
*IS *
*REC(FACTOR=1 )
*ENDWHEN
*COMMIT
Copy of quantity to daily production
*XDIM_MEMBERSET TV_PROD =QUANTITY
*DESTINATION_APP = Daily_production
*RENAME_DIM TIME = DAY
*WHEN TV_PROD
*IS QUANTITY
*REC(FACTOR=1,TIME=TIME.IMPJ)
*ENDWHEN
*COMMIT
-the property IMPJ is where I MAPP months to my Imputation members of DAY dimension .
Example
ID =2016.01 IMPJ: 2016.01.IMP so values are sent to 2016.01.IMP in the DAY dimension.
the allocation I did is :
*SUB SPLITDAY("M")
*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM DAY WHAT="M".IMP; WHERE=BAS("M")) ; USING=BAS("M") ; TOTAL=<<<;
*DIM TV_PROD WHAT=QUANTITY ; WHERE=QUANTITY_D; USING=CAL;
*DIM PRODUCTION_ORDER WHAT=NA ; WHERE=[ALL]; USING=<<<;
*ENDALLOCATION
*COMMIT
*ENDSUB
SPLITDAY(2016.01)
SPLITDAY(2016.02)
SPLITDAY(2016.03)
but it's not woring because we have CAL values are in Production order =NON Applicable
and quantity is by other members .
do you have any idea how can we resolve that ?
regards and thanks in advance.
Request clarification before answering.
Comparing the report and the script I can see that:
*DIM ORDRE_FAB WHAT=NA ; WHERE<>NA; USING=<<<; - Incorrect
Has to be like:
*DIM ORDRE_FAB WHAT<>NA ; WHERE<>NA; USING=NA; TOTAL<>NA
Your source value for allocation is located in <>NA
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ups, ONLY one line for *DIM ORDRE_FAB has to be in the script and the correct one is:
*DIM ORDRE_FAB WHAT<>NA ; WHERE<>NA; USING=NA; TOTAL=NA
Just typo from my side!
Hi Vadim,
After executing this script , it's giving wrong results . it's like it aggregate all members of Ordre_FAB <>NA and then do the split .
here is the result what do you suggest ?
Quantity of different order for the same workcenter

Quantity splited for the 3rd member of production order.
normaly we shoud have for PROD1_J for 000002001161: 5000 in the total and not 20060 .
500/31=161,29 each day and not 20060/31=647,096


what do you suggest ?
regards
If you don't want to have aggregation use:
*DIM_NONAGGR ORDRE_FAB ...
instead of *DIM ORDRE_FAB...
Sorry, but it's a bad idea to provide some code with SUB's etc...
Please provide clear test code and explanation of the logic!
P.S. Why you are still using useless COMMIT in your code????
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM DAY WHAT=2016.01.IMP; WHERE=BAS(2016.01); USING=BAS(2016.01) ; TOTAL=<<<;
*DIM TV_PROD WHAT=QUANTITY ; WHERE=QUANTITY_D; USING=CAL;
*DIM PRODUCTION_ORDER WHAT=NA ; WHERE=[ALL]; USING=<<<;
*ENDALLOCATION
here is an example of my values before allocation
quantity:first cloumn production order , Day, workcenter
Calendar: order day workcenter calendrier.png
for the acclocation log , i'm working in frensh so I tried to translate my diemsnsions and Members so you can understand the logic of it.
Production_ORDER is FAB_ORDRE
Quantity is PROD1 , Quantity_D is PROD1_J and CAL is PROD2_J
the result of the exectution of my allocation.
LGX:
*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM JOUR WHAT=2016.01.IMP; WHERE=BAS(2016.01); USING=BAS(2016.01) ; TOTAL=<<<;
*DIM TV_PROD_J WHAT=PROD1 ; WHERE=PROD1_J; USING=PROD2_J;
*DIM ORDRE_FAB WHAT=NA ; WHERE<>NA; USING=<<<;
*ENDALLOCATION
-------------------------------------------------------------------------------------------------------------------------------------
LOG:
LOG BEGIN TIME:2017-02-09 12:44:47
FILE:\ROOT\WEBFOLDERS\PLANNING_SHELL1 \ADMINAPP\previsionnel_prod_j\TEST.LGF
USER:FELAMRANI
APPSET:PLANNING_SHELL1
APPLICATION:previsionnel_prod_j
FACTOR:USING/TOTAL
ALLOCATION DATA REGION:
JOUR:WHAT:2016.01.IMP,WHERE:01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016,11.01.2016,12.01.2016,13.01.2016,14.01.2016,15.01.2016,16.01.2016,17.01.2016,18.01.2016,19.01.2016,20.01.2016,21.01.2016,22.01.2016,23.01.2016,24.01.2016,25.01.2016,26.01.2016,27.01.2016,28.01.2016,29.01.2016,30.01.2016,31.01.2016,USING:01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016,11.01.2016,12.01.2016,13.01.2016,14.01.2016,15.01.2016,16.01.2016,17.01.2016,18.01.2016,19.01.2016,20.01.2016,21.01.2016,22.01.2016,23.01.2016,24.01.2016,25.01.2016,26.01.2016,27.01.2016,28.01.2016,29.01.2016,30.01.2016,31.01.2016,TOTAL:<<<
TV_PROD_J:WHAT:PROD1,WHERE:PROD1_J,USING:PROD2_J,TOTAL:
ORDRE_FAB:WHAT:NA,WHERE:<>NA,USING:<<<,TOTAL:
-----------------------------------------
--Read WHAT region
[JOUR] =2016.01.IMP
[TV_PROD_J] =PROD1
[ORDRE_FAB] =NA
--Time to load WHAT :1.007571 second(s).
WHAT data:0 records.
-----------------------------------------
--Read USING region
[JOUR] =01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016
--Time to load USING :0.785201 second(s).
USING data:0 records.
-----------------------------------------
--Merge WHAT and USING
--Time to merge WHAT and USING :0.00001 second(s).
Data after merging WHAT and USING :0 records.
-----------------------------------------
--Apply factor
[JOUR] =01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016
TOTAL data:0 records.
WHERE=WHAT *USING/TOTAL
--Time to apply factor :0.624738 second(s).
-----------------------------------------
--Read destination and calculate difference
[JOUR] =01.01.2016,02.01.2016,03.01.2016,04.01.2016,05.01.2016,06.01.2016,07.01.2016,08.01.2016,09.01.2016,10.01.2016
--Time to read destination and calculate difference :0.531749 second(s).
-----------------------------------------
--Records succeeded to write back :0
-----------------------------------------
--Time to run Allocation :2.955385 second(s).
SCRIPT RUNNING TIME IN TOTAL:4.00 s.
LOG END TIME:2017-02-09 12:44:47
Please read again: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/
Point number 9!
Also please use "Insert Image" button to insert images inline, not links!
You have to show report with data sample before allocation!
From the log it's absolutely clear that you have no data:
WHAT data:0 records
...
here is athe report with all members , it impossible to list all values of members of my dimension because I have a lot

values with ID's from the script log.
here is a screen shot of all values of my dimension:

and here is the calendar PROD_J

i'm trying to do my best to give a clear description . this need is complicated .
| User | Count |
|---|---|
| 41 | |
| 4 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 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.