Skip to Content

validate my script logic: reference erro LOOKUP is not defined

Dear all,

i want write one script logic. It use LOOKUP using FOR/NEXT.

But when i check stament in my script logic: messesage erro: reference erro LOOKUP is not defined.Can you help me?

My script logic

*XDIM_MEMBERSET ACCOUNT=BS221

*XDIM_ADDMEMBERSET CATEGORY = Actual

*XDIM_ADDMEMBERSET ENTITY = CSO

*SELECT(%TIME%,"[ID]",TIME,"[ID]>=2006.01 AND [ID]<=2006.02")

*XDIM_MEMBERSET TIME = %TIME%

*LOOKUP Rates

*DIM CATEGORY ="Actual"

*DIM R_ACCOUNT ="AVG"

*DIM R_ENTITY ="Global"

*DIM INPUTCURRENCY="USD"

*DIM MEASURES ="PERIODIC"

*FOR %T% = %TIME%

*DIM RATE_%T%: TIME =%T%

*NEXT

*ENDLOOKUP

*WHEN ACCOUNT

*IS "BS221"

*FOR %T1% = %TIME%

*REC(EXPRESSION=LOOKUP(RATE_%T1%),TIME=%T%)

*NEXT

*ENDWHEN

*COMMIT

Thanks,

Hungth

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 23, 2014 at 07:54 AM

    Question:

    Why do you need to use FOR/NEXT for TIME at all?

    *LOOKUP Rates

    *DIM CATEGORY ="Actual"

    *DIM R_ACCOUNT ="AVG"

    *DIM R_ENTITY ="Global"

    *DIM RATE:INPUTCURRENCY="USD"

    *ENDLOOKUP

    *XDIM_MEMBERSET ACCOUNT=BS221

    *XDIM_MEMBERSET CATEGORY = Actual // Why ADDMEMBERSET???

    *XDIM_MEMBERSET ENTITY = CSO // Why ADDMEMBERSET???

    *SELECT(%TIME%,"[ID]",TIME,"[ID]>=2006.01 AND [ID]<=2006.02")

    *XDIM_MEMBERSET TIME = %TIME%

    *WHEN ACCOUNT

    *IS "BS221"

    *REC(EXPRESSION=LOOKUP(RATE))

    *ENDWHEN

    TIME in lookup will be a current TIME member in WHEN/ENDWHEN loop.

    But I don't understand what is the idea of this code...

    And please NEVER USE COMMIT WITH WHEN/ENDWHEN!

    Vadim

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi hungth,

      It looks like script that Vadim suggested is going to do what you want.

      Error in your script is that you are using variable %T% outside of the FOR/NEXT loop where it's defined. You probably should have TIME = %T1% in REC statement, but Vadim's option is much more efficient and elegant.

      Regards,

      Gersh

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.