Skip to Content
0

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

Feb 02, 2017 at 03:30 PM

124

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded

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.

0
Alan Guillermo Valenzuela Amezquita

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

1
* Please Login or Register to Answer, Follow or Comment.

7 Answers

Best Answer
Vadim Kalinin Feb 02, 2017 at 03:40 PM
0

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 :)

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

0
avatar image
Former Member Feb 03, 2017 at 10:35 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

"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
1

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

0
Vadim Kalinin Feb 03, 2017 at 10:47 AM
0

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!

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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

0
avatar image
Former Member Feb 03, 2017 at 11:39 AM
0

Ok but I can tell it works without specifying MEASURE

Show 1 Share
10 |10000 characters needed characters left characters exceeded

"it" - what?

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

0
avatar image
Former Member Feb 03, 2017 at 01:03 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Vadim Kalinin Feb 03, 2017 at 01:48 PM
0

it depends on bpc version and SP.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 03, 2017 at 02:54 PM
0

Thanks, good to know that!

Share
10 |10000 characters needed characters left characters exceeded