Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed 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.

  • Vadim Kalinin 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

  • Get RSS Feed

7 Answers

  • Best Answer
    Feb 02, 2017 at 03:40 PM

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

    Add comment
    10|10000 characters needed characters exceeded

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

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 03, 2017 at 10:47 AM

    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!

    Add comment
    10|10000 characters needed characters exceeded

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

    Ok but I can tell it works without specifying MEASURE

    Add comment
    10|10000 characters needed characters exceeded

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

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

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 03, 2017 at 01:48 PM

    it depends on bpc version and SP.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 03, 2017 at 02:54 PM

    Thanks, good to know that!

    Add comment
    10|10000 characters needed characters exceeded