on 04-06-2016 10:34 AM
Hi Guys,
I'm having one issue with Lookup function in Script Logic
Let's say I have a MODEL: HR_AUX
where I have one fixed values for KPI8 and KPI 9
LOOKUP HR_AUX
*DIM TIME = "2016.INP"
*DIM CATEGORY = "Forecast"
*DIM VALUEX:HR_ACCOUNT = KPI_8
*DIM VALUEY:HR_ACCOUNT = KPI_9
*DIM ENTITY = "XPTO"
*DIM RPTCURRENCY = "LC"
*FOR %LOOP_ZCOUNTRY% = %ZCOUNTRY%
*DIM Z_COUNTRY = %LOOP_ZCOUNTRY%
*NEXT
*FOR %LOOP_ZNATION% = %ZNATION%
*DIM Z_NATION = %LOOP_ZNATION%
*NEXT
*DIM MEASURES = "PERIODIC"
*ENDLOOKUP
*XDIM_MEMBERSET ENTITY= XPTO
*XDIM_MEMBERSET CATEGORY = Forecast
*XDIM_MEMBERSET TIME = 2016.INP
*XDIM_MEMBERSET AUDITTRAIL = InputHR
*XDIM_MEMBERSET EMPLOYEE = %EMPLOYEE_SET%
*XDIM_FILTER EMPLOYEE = [EMPLOYEE].Properties("NEW_EMP") = X
*WHEN HR_ACCOUNT
*IS KPI_1
*REC(EXPRESSION = 1 * LOOKUP(VALUEX), HR_ACCOUNT = KPI_8)
*REC(EXPRESSION = 1 * LOOKUP(VALUEY), HR_ACCOUNT = KPI_9)
*ENDWHEN
The issue here is
in my input template when I put something input in KPI_1 for respective employee
it is filling only the KPI_9 with 10.000
and the KPI_8 it is not filling cumming blank
the problem here is:
*DIM VALUEX:HR_ACCOUNT = KPI_8
*DIM VALUEY:HR_ACCOUNT = KPI_9
is something here I'm doing wrong, but, I don't know what.
thanks.
Regards,
IS it default.lgf? Please read my article how to ask questions about script logic!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vadim,
I tried whole possibilites..
I don't know why it is not taking:
*SELECT(%ZCOUNTRY%,COUNTRYID,S_BU_REG,"ID = %S_BU_REG_SET%")
*SELECT(%ZNATION%,NATION,EMPLOYEE,"ID = %EMPLOYEE_SET%")
*LOOKUP HR_AUX
*DIM TIME = "2016.INP"
*DIM CATEGORY = "Forecast"
*FOR %X_1% = KPI_8, KPI_9
*DIM HLT_%X_1%:HR_ACCOUNT = %X_1%
*NEXT
*DIM ENTITY = XPTO
*DIM RPTCURRENCY = "LC"
*FOR %LOOP_ZCOUNTRY% = %ZCOUNTRY%
*DIM Z_COUNTRY = %LOOP_ZCOUNTRY%
*NEXT
*FOR %LOOP_ZNATION% = %ZNATION%
*DIM Z_NATION = %LOOP_ZNATION%
*NEXT
*DIM MEASURES = "PERIODIC"
*ENDLOOKUP
*XDIM_MEMBERSET ENTITY = XPTO
*XDIM_MEMBERSET CATEGORY = Forecast
*XDIM_MEMBERSET TIME = 2016.INP
*XDIM_MEMBERSET AUDITTRAIL = InputHR
*XDIM_MEMBERSET EMPLOYEE = %EMPLOYEE_SET%
*XDIM_FILTER EMPLOYEE = [EMPLOYEE].Properties("NEW_EMP") = X
*WHEN HR_ACCOUNT
*IS KPI_1
*FOR %X_1% = KPI_8
*REC(EXPRESSION = 1 * LOOKUP(HLT_%X_1%), HR_ACCOUNT = KPI_8)
*NEXT
*FOR %X_1% = KPI_9
*REC(EXPRESSION = 1 * LOOKUP(HLT_%X_1%), HR_ACCOUNT = KPI_9)
*NEXT
*ENDWHEN
LGX:
*LOOKUP HR_AUX
*DIM TIME = "2016.INP"
*DIM CATEGORY = "Forecast"
*DIM HLT_KPI_8:HR_ACCOUNT = KPI_8
*DIM HLT_KPI_9:HR_ACCOUNT = KPI_9
*DIM ENTITY = "XPTO"
*DIM RPTCURRENCY = "LC"
*DIM Z_COUNTRY = 10
*DIM Z_NATION = EO
*DIM MEASURES = "PERIODIC"
*ENDLOOKUP
*XDIM_MEMBERSET ENTITY=XPTO
*XDIM_MEMBERSET CATEGORY = Forecast
*XDIM_MEMBERSET TIME = 2016.INP
*XDIM_MEMBERSET AUDITTRAIL = InputHR
*XDIM_MEMBERSET EMPLOYEE = johndoe
*XDIM_FILTER EMPLOYEE = [EMPLOYEE].Properties("NEW_EMP") = X
*WHEN HR_ACCOUNT
*IS KPI_1
*REC(EXPRESSION = 1 * LOOKUP(HLT_KPI_8), HR_ACCOUNT = KPI_8)
*REC(EXPRESSION = 1 * LOOKUP(HLT_KPI_9), HR_ACCOUNT = KPI_9)
*ENDWHEN
-------------------------------------------------------------------------------------------------------------------------------------
LOG:
LOG BEGIN TIME:2016-04-06 15:23:13
FILE:\ROOT\WEBFOLDERS\BPC_PROT \ADMINAPP\HR\TEST.LGF
USER:MICHELP
APPSET:BPC_PROT
APPLICATION:HR
[INFO] GET_DIM_LIST(): I_APPL_ID="HR", #dimensions=11
CATEGORY,COMP_CODE,EMPLOYEE,HR_ACCOUNT,MEASURES,OP_COSTCENTER,PROFIT_CTR,RPTCURRENCY,ENTITY,AUDITTRAIL,TIME
#dim_memberset=5
ENTITY:XPTO,1 in total.
CATEGORY:Forecast,1 in total.
TIME:2016.INP,1 in total.
AUDITTRAIL:InputHR,1 in total.
EMPLOYEE:johndoe,1 in total.
REC :1 * LOOKUP(HLT_KPI_8)
REC :1 * LOOKUP(HLT_KPI_9)
CALCULATION BEGIN:
QUERY PROCESSING DATA
QUERY TIME : 1.00 ms. 2 RECORDS QUERIED OUT.
QUERY REFERENCE DATA
QUERY LOOKUP DATA FROM APPLICATION: HR_AUX
QUERY TIME : 0.00 ms. 1 RECORDS QUERIED OUT.
CALCULATION TIME IN TOTAL :0.00 ms.
4 RECORDS ARE GENERATED.
CALCULATION END.
ENDWHEN ACCUMULATION: 4 RECORDS ARE GENERATED.
DATA TO WRITE BACK:
CATEGORY COMP_CODE EMPLOYEE HR_ACCOUNT OP_COSTCENTER PROFIT_CTR RPTCURRENCY ENTITY AUDITTRAIL TIME SIGNEDDATA
Forecast 1001 johndoe KPI_8 1001501001 AMCO EUR XPTO InputHR 2016.INP 0.00
Forecast 1001 johndoe KPI_8 1001501001 AMCO USD XPTO InputHR 2016.INP 0.00
Forecast 1001 johndoe KPI_9 1001501001 AMCO EUR XPTO InputHR 2016.INP 10000.00
Forecast 1001 johndoe KPI_9 1001501001 AMCO USD XPTO InputHR 2016.INP 10000.00
4 RECORDS HAVE BEEN WRITTEN BACK.
WRITING TIME :1.00 ms.
SCRIPT RUNNING TIME IN TOTAL:2.00 s.
LOG END TIME:2016-04-06 15:23:14
At least incorrect for/next usage inside lookup - each dim has to get unique label.
THe rest is also strange- lookup in rec without %VALUE% is a bad practice - use push instead of pull.
Vadim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
16 | |
3 | |
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.