cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Logic syntax error when using %variables%

Former Member
0 Likes
759

Hi all,

I'm facing a strange behavior on my script logic.

Like the code below shows, I intend to calculate a value multiplying a measure by another.

 

*WHEN INDIC

  *IS IND0006

      *BEGIN

        *REC(INDIC="IND0048",EXPRESSION=%VALUE% * ( [INDIC].[IND0004],[TIME].[%TIME_SET%] ) )

      *END

*ENDWHEN

*COMMIT

As the indicator IND0004 has value just in January, I'm using a dynamic variable to get total of the year (2012.TOTAL for example).

This way the admin is triggering the folowing message: "LINE 0 syntax error: "missing ) in parenthetical"

Then I replaced the %TIME_SET% by a hard code value, as below:

  *WHEN INDIC

  *IS IND0006

      *BEGIN

        *REC(INDIC="IND0048",EXPRESSION=%VALUE% * ( [INDIC].[IND0004],[TIME].[2012.TOTAL] ) )

      *END

*ENDWHEN

*COMMIT

And the error does not recur.

A strange thing too, is that in UJKT the code is validated in both ways.

Any help is welcome.

Thank you in advance.

Regards

Lucas Costa

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Hi Lucas,

yes the issue was an instruction different from EXPRESSION or FACTOR after the REC statement.

I'm sorry but I've problem with the image, they open only as blank form, thats why I just see your last post where the statement was just copied as text. So if you hope in another help by me, you must copy all the text inside the message,

but help maybe comes tomorrow, now I must escape .

Kind regards

     Roberto

Former Member
0 Likes

No problem Roberto,

I'll not work in that anymore, if is working...for me it's ok.

Thanks for your help! Have a nice one!

Regards,

Lucas Costa

Former Member
0 Likes

Hi Lucas,

In UJKT Validation doesn't substitute %DIM_SET% variables, try simulation.

Regards,

Gersh

Former Member
0 Likes

Hi Gersh,

Thanks for your reply.

But in UJKT there is a place (an area above of the area where the script is put) that replace the %DIM_SET%, so that when you do not put the value of DIM_SET in that area, there is a syntax error.

As I use just the %TIME_SET%, I placed TIME=2012.TOTAL, and works fine.

Further, I have tried simulation, through a package but is showing the same error that is showed in admin. In UJKT, through the EXECUTE button is working fine the same code.

I think that the central problem is why the admin is triggering an error when I use the %DIM_SET% variable, further, this error of parentheses.

Thanks in Advance.

Regards

Lucas

Former Member
0 Likes

Hi Lucas,

What version of BPC are you running? I re-tested it in BPC 10 SP05 and UJKT still does't substitute DIM_SET from Data Region area.

If you have %TIME_SET% = 2012.TOTAL then you should have an error in both Simulation and Execution modes: you can't write to a Node.

Regards,

Gersh

Former Member
0 Likes

Hi Gersh,

In UJKT I have no error, either in simulation either execution. Only BPC Admin.

Below is my execution in UJKT replacing the %TIME_SET% variable.

Regards

Lucas Costa

Former Member
0 Likes

Hi Lucas,

Can you please post your UJKT log of execution? BPC can not post data to a Node. Is your 2012.TOTAL a Node or a base member? Simulation doesn't check that.

Regards,

Gersh

Former Member
0 Likes

Hi Gersh,

2012.TOTAL is node. And I'm not trying to add data to the node. Please note that my *XDIM_MEMBERSET is defined as BAS(%TIME_SET%), in other words just processing the months, that is the bas members.

In the following line:

*REC(INDIC="IND0048",EXPRESSION=%VALUE% * ( [INDIC].[IND0004],[TIME].[%TIME_SET%] ) ) 

I used %TIME_SET% to bring all values of a year.

Regards

Lucas

Former Member
0 Likes

Hi Lucas,

could you try with

*REC(EXPRESSION=%VALUE% * ( [INDIC].[IND0004],INDIC="IND0048",[TIME].[%TIME_SET%] ) ) 

Kind regards

     Roberto

Former Member
0 Likes

Thanks Roberto,

But occurs the same error described above: "missing ) in parenthetical".

Thanks in advance.

Regards

Lucas Costa

Former Member
0 Likes

Hi Lucas,

sorry try this

*REC(EXPRESSION=%VALUE% * ( [INDIC].[IND0004]),INDIC="IND0048",[TIME].[%TIME_SET%]  ) 

Kind regards

     Roberto

Former Member
0 Likes

Thansk Roberto,

Now is saving without error, but when I execute, is producing 0. It's not doing the right selection.

This script is modularized, so I took off the *COMMIT statement, and put it into the main *INCLUDE, and is working fine. The error still there, but it's working.

Thanks all for your help.

Regards,

Lucas Costa

Former Member
0 Likes

Hi Lucas,

*XDIM_MEMBERSET doesn't change %DIM_SET%, so you %TIME_SET% is still 2011.TOTAL.

I'm not sure what you trying to achieve with that REC - populate all records of the year with same value? If this is correct, you'd need a FOR/NEXT loop on %TIME_SET% around that *REC.

Regards,

Gersh