cancel
Showing results for 
Search instead for 
Did you mean: 

BPC 10.1 NW LOOKUP Data on same member of 1 dimension as current record

0 Kudos

Dear experts,

Inside DEFAULT.LGF, I am using LOOKUP to get a value that is stored in the same member of COMPANY dimension as the current member of the record being treated. For other dimensions the value is stored on specific members, this part is not a problem.

I am stuck one the syntax on the DIM instruction for COMPANY as indicated below:

*LOOKUP PurchasePlan  
*DIM FOB:ACCOUNT = ACC_93   
*DIM FOB:TIME=Year.INP   
*DIM FOB:SUPPLIER=SUP_UNDEF   
*DIM FOB:COMPANY= ???  //what syntax to use?
*DIM FOB:PHASE=P_002
*ENDLOOKUP

Then my calling code will be

*WHEN ACCOUNT
*IS ACC_52
*REC(FACTOR=LOOKUP(FOB),ACCOUNT=ACC_162) //FOB
*ENDWHEN

I have tried the following with no success (no value retrieved by LOOKUP(FOB))

*DIM FOB:COMPANY=COMPANY.ID
*DIM FOB:COMPANY=COMPANY

One solution I found is working is to write it as follow:

*DIM FOB:COMPANY=%COMPANY_SET%

But it works only it my scope have only 1 COMPANY.

When I load a file that have data of 2 different COMPANY and that triggers the DEFAULT logic, the package fails and I have the following error:

(DI45 and DI75 are members of COMPANY dimension).

So it seems all company members are inside %COMPANY_SET% variable at the same time.

Any help would be very appreciated.

Thanks in advance

Alexandre

alan_valenzuela
Participant
0 Kudos

Hi, I am trying to understand, if you want to use a property of the dimension COMPANY, you should to use *SELECT and then use the variable inside the LOOKUP command.

former_member186338
Active Contributor

Sorry Alan, but in this case the topic author don't want to use the property, just current member of COMPANY in WHEN/ENDWHEN.

And in case of property you don't need to use SELECT for LOOKUP - just *DIM DIMNAME=DIMNAME.PROPERTYNAME

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Sorry, but why do you want to use LOOKUP at all? Are you looking for a value in another model?

If you are looking data in another model - simply delete the line with *DIM FOB:COMPANY=...

If not specified the current record COMPANY will be used 🙂

former_member186338
Active Contributor
0 Kudos

If you are looking for a value in the same model then use tuple expression instead of LOOKUP!

Answers (6)

Answers (6)

0 Kudos

Thanks, good to know that!

former_member186338
Active Contributor
0 Kudos

it depends on bpc version and SP.

0 Kudos

I meant LOOKUP works inside DEFAULT.LGF without MEASURE, I used it.

0 Kudos

Ok but I can tell it works without specifying MEASURE

former_member186338
Active Contributor
0 Kudos

"it" - what?

MEASURE is required only if you use LOOKUP in default.lgf!

former_member186338
Active Contributor
0 Kudos

Please read my blog https://blogs.sap.com/2014/06/09/how-to-write-defaultlgf/

In the LOOKUP sample you will see the MEASURE defined!

former_member186338
Active Contributor
0 Kudos

Just spend some time on formatting the mentioned blog to make it readable after migration!

0 Kudos

Hello Vadim,

Thanks for your answer, actually I am looking for a data inside the same model. I used to do this using a tuple but after discussing with a BPC consultant he adviced me to use LOOKUP even in the same model. Actually I found it pretty convenient and with good performance. You don't think it is a good solution?

The problem seems to be specific to the DEFAULT logic because when I remove the line of the COMPANY dimension the calculation is not happening, however when I do the same in another script logic it works fine!

Anyway thanks for confirming that removing the line was the correct solution.

Alexandre

former_member186338
Active Contributor

"he adviced me to use LOOKUP" 🙂 strange consultant!

Code has to be:

*WHEN ACCOUNT
*IS ACC_52
*REC(FACTOR=([ACCOUNT].[ACC_93],[TIME].[Year.INP],[SUPPLIER].[SUP_UNDEF],[PHASE].[P_002]),ACCOUNT=ACC_162) //FOB
*ENDWHEN
former_member186338
Active Contributor
0 Kudos

P.S. For LOOKUP in default.lgf you have to specify MEASURE...