on 2016 Jul 15 6:13 PM
Hi Experts,
Business logic
I have a KPI wich is rate of production,
So I have Daily production : loaded value and Calendar wich is an input value
rate of production = Cumulative value of production and / cumulative value of calendar.
so normaly the script should be executed after inputing value of calendar loading value of daily production ( DM , daily load )
both of cumulative value of production and cumulative value of calendar are ACCTYPE AST.
normaly the cumulative value should be repated till the end of year .
Scipt :
daily calendar of treatement :EXTR0020
cumulative value of calendar:EXT001757
Daily production :EXTR0094
Cumulative value of production:EXTR00940
rate of production:EXTR0021
so I have in my DEFAULT
//EXTR0020->input value
*XDIM_MEMBERSET MEASURES = PERIODIC
*WHEN TV_EXTRACTION
*IS EXTR0020
*REC(EXPRESSION=[MEASURES].[YTD],TV_EXTRACTION = EXT001757)
*ENDWHEN
*COMMIT
//EXT001757-> input value
*WHEN TV_EXTRACTION
*IS EXT001757
*REC(EXPRESSION=[TV_EXTRACTION].[EXTR00940]/[TV_EXTRACTION].[EXT001757],TV_EXTRACTION = EXTR0021)
*ENDWHEN
*COMMIT
////Allocation
*SELECT(%LASTTID%,[TIMEID],JOUR,ID=%JOUR_SET%)
*SELECT(%Y%,[YEAR],JOUR,ID=%JOUR_SET%)
*SELECT(%BS%,[ID],TV_EXTRACTION,ACCTYPE=AST)
*SELECT(%TARGET%,[ID],JOUR,TIMEID>%LASTTID% AND YEAR=%Y% AND CALC=N)
*XDIM_MEMBERSET TV_EXTRACTION=%BS%
*RUNALLOCATION
*FACTOR=1
*DIM JOUR WHAT=%JOUR_SET%;WHERE=%TARGET%
*ENDALLOCATION
*COMMIT
CUMUL.LGF
//Cmulatiive production
*XDIM_MEMBERSET JOUR=BAS(2016)
*XDIM_MEMBERSET TV_EXTRACTION=EXTR0094
*XDIM_MEMBERSET MEASURES = PERIODIC
*WHEN_REF_DATA = MASTER_DATA
*WHEN TV_EXTRACTION
*IS *
*REC(EXPRESSION=[MEASURES].[YTD],TV_EXTRACTION = EXTR00940)
*ENDWHEN
*COMMIT
//
//rate of production
*XDIM_MEMBERSET TV_EXTRACTION=EXTR00940
*XDIM_MEMBERSET JOUR=BAS(2016)
*WHEN_REF_DATA = MASTER_DATA
*WHEN TV_EXTRACTION
*IS *
*REC(EXPRESSION=%VALUE%/[TV_EXTRACTION].[EXT001757],TV_EXTRACTION = EXTR0021)
*ENDWHEN
*COMMIT
When I execute The Default.LGF and then CUMIL.LGF I have correct result
in the loaded value but not the input value.
and when I write an input value the cumulative value of the loaded value is not correct .
You find bellow the sceenshots.
thank you.
regards
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please simplify the case - without division! Create member formula for EXTR0021.
Please provide ACCTYPE for the accounts used in script logic! What is the model storage type?
"When I execute The Default.LGF and then CUMIL.LGF I have correct result
in the loaded value but not the input value.
and when I write an input value the cumulative value of the loaded value is not correct ."
Please explain step by step what are you doing?
What do you mean by "input value"? What value?
Hi Vadim ,
thank' s for reply, so I have :
daily calendar of treatement :EXTR0020 -EXP
cumulative value of calendar:EXT001757 - AST
Daily production :EXTR0094 - EXP
Cumulative value of production:EXTR00940 AST
all cumulative values are AST wich is normal and the last value should be repeated till the last month to have value at year and .
I have to Types of KPI , one should be inputed , other should be loaded , and fot both types we should calculate the cumulative value .
- the storage of the model is Periodic .
Steps
1- load value or inputed value( using save button)
-> load value the calculation of the cumulative value using Cumul.LGF
->Inputed value the calculation are in the DEfauTl.lgf
2-Allocation should be executed : repeating last value of the cumated KPI till las month of year.
regards
I have shceduled the packege linf to run every day , and in this pckages link ( the default.LGF run first and then the cumul.LGF run after,
for the DM load I have /CPMB/LOAD_INFOPROV_UI with no selection. standard advanced script
and for the cumul.LGF I Have /CPMB/DEFAULT_FORMULAS
advanced script : stadard
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SUSER,%USER%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPPSET,%APPSET%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,SAPP,%APP%)
TASK(/CPMB/DEFAULT_FORMULAS_LOGIC,LOGICFILENAME,CUMUL.LGF)
Ok, let me try to explain the most common scenario:
Each day the data can be loaded for EXTR0094 for some days within one year
Each day the data can be saved using input template for EXTR0020 for some days within one year.
You want to have YTD results of EXTR0094 and EXTR0020 in EXT001757 and EXTR00940 in all days of the current year.
The rest can be calculated using dimension member formulas.
Is it correct?
Then calculate both in default.lgf:
*XDIM_MEMBERSET JOUR=BAS(2016)
*XDIM_MEMBERSET MEASURES = PERIODIC
*WHEN_REF_DATA = MASTER_DATA
*WHEN TV_EXTRACTION
*IS EXTR0094
*REC(EXPRESSION=[MEASURES].[YTD],TV_EXTRACTION = EXTR00940)
*IS EXTR0020
*REC(EXPRESSION=[MEASURES].[YTD],TV_EXTRACTION = EXT001757)
*ENDWHEN
And in /CPMB/LOAD_INFOPROV_UI set the parameter to run default.lgf. No package link!
P.S. This script will recalculate everything for the whole year for this 2 accounts. If you need better performance - then badi.
For AST Member it's Okay because we have the division of last values , for the client some time I have KPI Ratio when I need to do calculation with member formula like percentages but at total for EXP ACCTYPES where I have :
The Nominator and the denominator are EXP members . here, the member formula is calculating using SUM of nomilator / sum of denominator , for some KPI it's useful for other KPI it's not useful i don't know how to explain the business logic because their calculation are very complicated and when i did this by formula , they said that they are not the correct values , that's why i did it with script and here the execution is not very optimized.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 7 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 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.