cancel
Showing results for 
Search instead for 
Did you mean: 

Lookup issue

former_member229754
Participant
0 Kudos

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,

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

IS it default.lgf? Please read my article how to ask questions about script logic!

former_member229754
Participant
0 Kudos

Hi Vadim,

yes, it is Default

How you would do this?

what you mean push instead pull?

Which is your blog link?

Thanks

former_member186338
Active Contributor
0 Kudos

Please, answer all questions here:  y

And read

former_member229754
Participant
0 Kudos

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

former_member186338
Active Contributor
0 Kudos

Sorry, looks like you have no time to answer the questions in how-to and you have not read about default.lgf. And I have no time to ask each question individually. Your script is incorrect.

Vadim

former_member229754
Participant
0 Kudos

Hi Vadim,

Sorry for taking time for answering you.

You are correct, i should provide you the whole correct information.

And The issue was in support package there is a note:

0002149307 LOOKUP Value is queried out incorrectly when multi LOOKUP

and an minor adjustment of my script

Thanks again.

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

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