on 06-29-2016 12:15 PM
Hi exprets ,
I'm have "a" wich is a loaded KPI from BW infoobject .
and I have "b" wich is the accumulated value of A ( accounttype AST)
and normaly the last value of "b" shoud be repeated till the last day of the year .
when i'm testing the script with an input value the scripts are working well but with loaded value and with launching data load process it's giving wrong results .
1-
*SAP_BW 740 0009 SAPKW74009 SAP Business Warehouse
*CPMBPC 801 0009 SAPK-80109INCPMBPC CPM Business Planning and Consolidation
2- DUMP
3-I Have 2 dimensions TV_Extraction and Time dimension" Temps".
TIME:01.01.2015,02.01.2015
TV_Extraction : a ,b
4-Default.LGF
5 'm trying to calculate the accumulated value of a and repead it till the last of year
6-this is the script i'm trying
//calculating accumulated value
*XDIM_MEMBERSET MEASURES = PERIODIC
*WHEN TV_EXTRACTION
*IS a
*REC(EXPRESSION = [MEASURES].[YTD],TV_EXTRACTION=b)
*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
7- Data like 7800
8-
LGX:
*XDIM_MEMBERSET TV_EXTRACTION=a,b
*XDIM_MEMBERSET MEASURES = PERIODIC
*WHEN TV_EXTRACTION
*IS a
*REC(EXPRESSION=[MEASURES].[YTD],TV_EXTRACTION = b)
*ENDWHEN
*COMMIT
*XDIM_MEMBERSET TV_EXTRACTION=EXT001757,EXTR00121,EXTR0015,EXTR00151,EXTR0017,EXTR00170,EXTR0017300,EXTR001755,EXTR001756,EXTR00180,EXTR001800,EXTR0018000,EXTR00230,EXTR00240,EXTR0026,EXTR0091,b,EXTR0157,EXTR0178,EXTR152,Impu_Calcul
*RUNALLOCATION
*FACTOR=1
*DIM JOUR WHAT=01.05.2016;WHERE=01.06.2016,01.07.2016,01.08.2016,01.09.2016,01.10.2016,01.11.2016,01.12.2016,02.05.2016,02.06.2016,02.07.2016,02.08.2016,02.09.2016,02.10.2016,02.11.2016,02.12.2016,03.05.2016,03.06.2016,03.07.2016,03.08.2016,03.09.2016,03.10.2016,03.11.2016,03.12.2016,04.05.2016,04.06.2016,04.07.2016,04.08.2016,04.09.2016,04.10.2016,04.11.2016,04.12.2016,05.05.2016,05.06.2016,05.07.2016,05.08.2016,05.09.2016,05.10.2016,05.11.2016,05.12.2016,06.05.2016,06.06.2016,06.07.2016,06.08.2016,06.09.2016,06.10.2016,06.11.2016,06.12.2016,07.05.2016,07.06.2016,07.07.2016,07.08.2016,07.09.2016,07.10.2016,07.11.2016,07.12.2016,08.05.2016,08.06.2016,08.07.2016,08.08.2016,08.09.2016,08.10.2016,08.11.2016,08.12.2016,09.05.2016,09.06.2016,09.07.2016,09.08.2016,09.09.2016,09.10.2016,09.11.2016,09.12.2016,10.05.2016,10.06.2016,10.07.2016,10.08.2016,10.09.2016,10.10.2016,10.11.2016,10.12.2016,11.05.2016,11.06.2016,11.07.2016,11.08.2016,11.09.2016,11.10.2016,11.11.2016,11.12.2016,12.05.2016,12.06.2016,12.07.2016,12.08.2016,12.09.2016,12.10.2016,12.11.2016,12.12.2016,13.05.2016,13.06.2016,13.07.2016,13.08.2016,13.09.2016,13.10.2016,13.11.2016,13.12.2016,14.05.2016,14.06.2016,14.07.2016,14.08.2016,14.09.2016,14.10.2016,14.11.2016,14.12.2016,15.05.2016,15.06.2016,15.07.2016,15.08.2016,15.09.2016,15.10.2016,15.11.2016,15.12.2016,16.05.2016,16.06.2016,16.07.2016,16.08.2016,16.09.2016,16.10.2016,16.11.2016,16.12.2016,17.05.2016,17.06.2016,17.07.2016,17.08.2016,17.09.2016,17.10.2016,17.11.2016,17.12.2016,18.05.2016,18.06.2016,18.07.2016,18.08.2016,18.09.2016,18.10.2016,18.11.2016,18.12.2016,19.05.2016,19.06.2016,19.07.2016,19.08.2016,19.09.2016,19.10.2016,19.11.2016,19.12.2016,20.05.2016,20.06.2016,20.07.2016,20.08.2016,20.09.2016,20.10.2016,20.11.2016,20.12.2016,21.05.2016,21.06.2016,21.07.2016,21.08.2016,21.09.2016,21.10.2016,21.11.2016,21.12.2016,22.05.2016,22.06.2016,22.07.2016,22.08.2016,22.09.2016,22.10.2016,22.11.2016,22.12.2016,23.05.2016,23.06.2016,23.07.2016,23.08.2016,23.09.2016,23.10.2016,23.11.2016,23.12.2016,24.05.2016,24.06.2016,24.07.2016,24.08.2016,24.09.2016,24.10.2016,24.11.2016,24.12.2016,25.05.2016,25.06.2016,25.07.2016,25.08.2016,25.09.2016,25.10.2016,25.11.2016,25.12.2016,26.05.2016,26.06.2016,26.07.2016,26.08.2016,26.09.2016,26.10.2016,26.11.2016,26.12.2016,27.05.2016,27.06.2016,27.07.2016,27.08.2016,27.09.2016,27.10.2016,27.11.2016,27.12.2016,28.05.2016,28.06.2016,28.07.2016,28.08.2016,28.09.2016,28.10.2016,28.11.2016,28.12.2016,29.05.2016,29.06.2016,29.07.2016,29.08.2016,29.09.2016,29.10.2016,29.11.2016,29.12.2016,30.05.2016,30.06.2016,30.07.2016,30.08.2016,30.09.2016,30.10.2016,30.11.2016,30.12.2016,31.05.2016,31.07.2016,31.08.2016,31.10.2016,31.12.2016
*ENDALLOCATION
*COMMIT
-------------------------------------------------------------------------------------------------------------------------------------
LOG:
FILE:\ROOT\WEBFOLDERS\PLANNING_SHELL1 \ADMINAPP\Extraction_Sucreries\TEST.LGF
USER:FELAMRANI
APPSET:PLANNING_SHELL1
APPLICATION:Extraction_Sucreries
[INFO] GET_DIM_LIST(): I_APPL_ID="Extraction_Sucreries", #dimensions=5
JOUR,MEASURES,SITE,TV_EXTRACTION,VERSION
#dim_memberset=3
JOUR:01.05.2016,1 in total.
TV_EXTRACTION:EXTR0094,EXTR00940,2 in total.
MEASURES:PERIODIC,1 in total.
REC :[MEASURES].[YTD]
CALCULATION BEGIN:
QUERY PROCESSING DATA
QUERY TIME : 0.00 ms. 3 RECORDS QUERIED OUT.
QUERY REFERENCE DATA
QUERY TIME : 2.00 ms. 3 RECORDS QUERIED OUT.
CALCULATION TIME IN TOTAL :0.00 ms.
3 RECORDS ARE GENERATED.
CALCULATION END.
FACTOR:1
ALLOCATION DATA REGION:
JOUR:01.05.2016,
TV_EXTRACTION:EXT001757,EXTR00121,EXTR0015,EXTR00151,EXTR0017,EXTR00170,EXTR0017300,EXTR001755,EXTR001756,EXTR00180,EXTR001800,EXTR0018000,EXTR00230,EXTR00240,EXTR0026,EXTR0091,EXTR00940,EXTR0157,EXTR0178,EXTR152,Impu_Calcul,
JOUR:WHAT:01.05.2016,WHERE:01.06.2016,01.07.2016,01.08.2016,01.09.2016,01.10.2016,01.11.2016,01.12.2016,02.05.2016,02.06.2016,02.07.2016,02.08.2016,02.09.2016,02.10.2016,02.11.2016,02.12.2016,03.05.2016,03.06.2016,03.07.2016,03.08.2016,03.09.2016,03.10.2016,03.11.2016,03.12.2016,04.05.2016,04.06.2016,04.07.2016,04.08.2016,04.09.2016,04.10.2016,04.11.2016,04.12.2016,05.05.2016,05.06.2016,05.07.2016,05.08.2016,05.09.2016,05.10.2016,05.11.2016,05.12.2016,06.05.2016,06.06.2016,06.07.2016,06.08.2016,06.09.2016,06.10.2016,06.11.2016,06.12.2016,07.05.2016,07.06.2016,07.07.2016,07.08.2016,07.09.2016,07.10.2016,07.11.2016,07.12.2016,08.05.2016,08.06.2016,08.07.2016,08.08.2016,08.09.2016,08.10.2016,08.11.2016,08.12.2016,09.05.2016,09.06.2016,09.07.2016,09.08.2016,09.09.2016,09.10.2016,09.11.2016,09.12.2016,10.05.2016,10.06.2016,10.07.2016,10.08.2016,10.09.2016,10.10.2016,10.11.2016,10.12.2016,11.05.2016,11.06.2016,11.07.2016,11.08.2016,11.09.2016,11.10.2016,11.11.2016,11.12.2016,12.05.2016,12.06.2016,12.07.2016,12.08.2016,12.09.2016,12.10.2016,12.11.2016,12.12.2016,13.05.2016,13.06.2016,13.07.2016,13.08.2016,13.09.2016,13.10.2016,13.11.2016,13.12.2016,14.05.2016,14.06.2016,14.07.2016,14.08.2016,14.09.2016,14.10.2016,14.11.2016,14.12.2016,15.05.2016,15.06.2016,15.07.2016,15.08.2016,15.09.2016,15.10.2016,15.11.2016,15.12.2016,16.05.2016,16.06.2016,16.07.2016,16.08.2016,16.09.2016,16.10.2016,16.11.2016,16.12.2016,17.05.2016,17.06.2016,17.07.2016,17.08.2016,17.09.2016,17.10.2016,17.11.2016,17.12.2016,18.05.2016,18.06.2016,18.07.2016,18.08.2016,18.09.2016,18.10.2016,18.11.2016,18.12.2016,19.05.2016,19.06.2016,19.07.2016,19.08.2016,19.09.2016,19.10.2016,19.11.2016,19.12.2016,20.05.2016,20.06.2016,20.07.2016,20.08.2016,20.09.2016,20.10.2016,20.11.2016,20.12.2016,21.05.2016,21.06.2016,21.07.2016,21.08.2016,21.09.2016,21.10.2016,21.11.2016,21.12.2016,22.05.2016,22.06.2016,22.07.2016,22.08.2016,22.09.2016,22.10.2016,22.11.2016,22.12.2016,23.05.2016,23.06.2016,23.07.2016,23.08.2016,23.09.2016,23.10.2016,23.11.2016,23.12.2016,24.05.2016,24.06.2016,24.07.2016,24.08.2016,24.09.2016,24.10.2016,24.11.2016,24.12.2016,25.05.2016,25.06.2016,25.07.2016,25.08.2016,25.09.2016,25.10.2016,25.11.2016,25.12.2016,26.05.2016,26.06.2016,26.07.2016,26.08.2016,26.09.2016,26.10.2016,26.11.2016,26.12.2016,27.05.2016,27.06.2016,27.07.2016,27.08.2016,27.09.2016,27.10.2016,27.11.2016,27.12.2016,28.05.2016,28.06.2016,28.07.2016,28.08.2016,28.09.2016,28.10.2016,28.11.2016,28.12.2016,29.05.2016,29.06.2016,29.07.2016,29.08.2016,29.09.2016,29.10.2016,29.11.2016,29.12.2016,30.05.2016,30.06.2016,30.07.2016,30.08.2016,30.09.2016,30.10.2016,30.11.2016,30.12.2016,31.05.2016,31.07.2016,31.08.2016,31.10.2016,31.12.2016,USING:,TOTAL:
SCRIPT RUNNING TIME IN TOTAL:5.00 s.
thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim ,
thank you for yoy very kind help.
not me , the client who want everything mixed
*WHEN TV_EXTRACTION
*IS EXTR0094
*REC(EXPRESSION=[MEASURES].[YTD],TV_EXTRACTION = EXTR00940)
*ENDWHEN
*COMMIT
here are my real dimension members
1 - data are loaded from fom BW to EXTR0094
2- "a" or EXTR0094 is EXP
3- I want to copy EXTR0094 a YTD to EXTR00940
4 then I want to copy the value of EXTR00940 to remaining months.
please if you need any additional information tell me .
Then:
Script is designed for default.lgf
Restrictions - the script will correctly run for single last month!
Only EXTR00940 will be affected.
//Copy YTD value of EXTR0094 to EXTR00940
*XDIM_MEMBERSET MEASURES = PERIODIC
*WHEN TV_EXTRACTION
*IS EXTR0094
*REC(EXPRESSION = [MEASURES].[YTD],TV_EXTRACTION=EXTR00940)
*ENDWHEN
//Copy current month value of EXTR00940 to remaining months
*SELECT(%LASTTID%,[TIMEID],JOUR,ID=%JOUR_SET%)
*SELECT(%Y%,[YEAR],JOUR,ID=%JOUR_SET%)
*SELECT(%TARGET%,[ID],JOUR,TIMEID>%LASTTID% AND YEAR=%Y% AND CALC=N)
*WHEN TV_EXTRACTION
*IS EXTR0094 //EXTR0094!!!!
*FOR %T%=%TARGET%
*REC(EXPRESSION=[TV_EXTRACTION].[EXTR00940],TIME=%T%,TV_EXTRACTION=EXTR00940)
*NEXT
*ENDWHEN
PROMPT(INFOPROVIDERSELECTION,%InforProvide%,%SELECTION%,"Please select the InfoProvider and set selection (InfoProvider list is restricted by both BW and BPC authority)",,)
PROMPT(TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
PROMPT(RADIOBUTTON,%TARGETMODE%,"Handling of records in target",0,{"Append","Overwrite records with match key","Replace data in same data region of Entity, Category, Time and Audit ID"},{"0","1","2"})
PROMPT(RADIOBUTTON,%RUNLOGIC%,"Select whether to run default logic for stored values after importing",1,{"Yes","No"},{"1","0"})
PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when importing data.",1,{"Yes, check for work status settings before importing","No, do not check work status settings"},{"1","0"})
PROMPT(KEYDATE,%KEYDATE%,"Key date",0)
INFO(%TEMPNO1%,%INCREASENO%)
INFO(%ACTNO%,%INCREASENO%)
INFO(%KEYDATE%,)
TASK(/CPMB/INFOPROVIDER_CONVERT,OUTPUTNO,%TEMPNO1%)
TASK(/CPMB/INFOPROVIDER_CONVERT,ACT_FILE_NO,%ACTNO%)
TASK(/CPMB/INFOPROVIDER_CONVERT,TRANSFORMATIONFILEPATH,%TRANSFORMATION%)
TASK(/CPMB/INFOPROVIDER_CONVERT,SUSER,%USER%)
TASK(/CPMB/INFOPROVIDER_CONVERT,SAPPSET,%APPSET%)
TASK(/CPMB/INFOPROVIDER_CONVERT,SAPP,%APP%)
TASK(/CPMB/INFOPROVIDER_CONVERT,FILE,%InforProvide%)
TASK(/CPMB/INFOPROVIDER_CONVERT,INFOPROV_SELECTION,%SELECTION%)
TASK(/CPMB/INFOPROVIDER_CONVERT,KEYDATE,%KEYDATE%)
TASK(/CPMB/LOAD_IP,PREPROCESSMODE,0)
TASK(/CPMB/LOAD_IP,TARGETMODE,%TARGETMODE%)
TASK(/CPMB/LOAD_IP,INPUTNO,%TEMPNO1%)
TASK(/CPMB/LOAD_IP,ACT_FILE_NO,%ACTNO%)
TASK(/CPMB/LOAD_IP,RUNLOGIC,%RUNLOGIC%)
TASK(/CPMB/LOAD_IP,CHECKLCK,%CHECKLCK%)
TASK(/CPMB/LOAD_IP,KEYDATE,%KEYDATE%)
I have written many times: "Restrictions - the script will correctly run for single last month!"
Single month!!!!!
"BT 20150101 and 20151231" - is not a single month!
You have to load data month after month for this script:
"*SELECT(%LASTTID%,[TIMEID],JOUR,ID=%JOUR_SET%)"
%JOUR_SET% has to contain single month
"I want to to load for whole year , I will execute just the script to accumulate values" - correct!
"i have last value of month(day) empty i will not have values in month and i will not have values in year and quarter :s" - not clear!
"i want to load data every day" - not clear! every day month data? or? Please, explain everything!
Senario 1:keep the current script and shcedule it
I have values for everyday , my time dimension members are : "01.01.2015" ,"02.01.2015" , so I should execute the data load process everyday normaly.
Senario 2: remove allocation
If I remove allocation and have 31.12.2016 empty I will have 12.2016 empty 2016 empty because it's AST Member , that's no what the client need i need value repated till the end of year :s
I will try to explain the business logic :
so I have a KPI which is daily cumulated production of sugar: so for example
i have value in
01.05.2016 : value of 800000
02.05.2016:850000
03.05.2016:i shoud have the value of 850000 repeated till 09.05.2016. because ( daily production is empty in this time)
09.05.2016 : 900000
and this value should be repeated till the last day of year .
and if I relaod data and I have value in 10.05.2016 this value should be reapted till last day of the year
You are loading not a cumulative production but daily production!
It can be some value or no value at all.
In case of no value the default.lgf will not work - simply no records for this account
Another issue: if you reload some previous (not last) day - ytd has to be recalculated!
If you have limited number of accounts the simplest way is to recalculate full year after daily load:
*XDIM_MEMBERSET MEASURES = PERIODIC
*XDIM_MEMBERSET JOUR=BAS(2015.TOTAL)
*XDIM_MEMBERSET TV_EXTRACTION=EXTR0094
//add extra XDIM...
*WHEN_REF_DATA = MASTER_DATA //will run script for all months - slow!
*WHEN TV_EXTRACTION
*IS *
*REC(EXPRESSION=[MEASURES].[YTD],TV_EXTRACTION=EXTR00940)
*ENDWHEN
Use DM package to run this script (no prompts)
Use package link to combine daily data load and DM with this script
Hi Vadim,
thank you for your rely,
when I try to execute the script for LTD Life to date from 2015.01 the allocation wich normaly works with YTD does nt work witch LTD , the calcul of the KPI is good but the value not repeating itself overtime
I have value in 2015.06 and value in 2015.07 and value in 2016.04 and normlay at 2016 i should have the sum of all this values .
that's what the client expect.
Hi vadim,
so I have KPI_I01 loaded value
KPI1040 : the cumulated value of KPI_I01 ( AST and we LTD measures life to date)
when I execute this script in Calculation.LGF
*XDIM_MEMBERSET MEASURES = PERIODIC
*XDIM_MEMBERSET TEMPS=BAS(2015.TOTAL)
*XDIM_MEMBERSET KPI_CDG =KPI_I01
*WHEN_REF_DATA = MASTER_DATA
*WHEN KPI_CDG
*IS *
*REC(EXPRESSION=[MEASURES].[LTD],KPI_CDG=KPI10406)
*ENDWHEN
*COMMIT
and this script in default .LGF
//Allocation
*SELECT(%LASTTID%,[TIMEID],TEMPS,ID=%TEMPS_SET%)
*SELECT(%Y%,[YEAR],TEMPS,ID=%TEMPS_SET%)
*SELECT(%BS%,[ID],KPI_CDG,ACCTYPE=AST)
*SELECT(%TARGET%,[ID],TEMPS,TIMEID>%LASTTID% AND YEAR=%Y% AND CALC=N)
*XDIM_MEMBERSET KPI_CDG=%BS%
*RUNALLOCATION
*FACTOR=1
*DIM TEMPS WHAT=%TEMPS_SET%;WHERE=%TARGET%
*ENDALLOCATION
*COMMIT
as you can see at the sceershot the allocation does not work why ?
and when I change [MEASURES].[LTD] to [MEASURES].[YTD] it's working
please if I was not clear in any of that don't hesitate to mention it
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.