Skip to Content
author's profile photo Former Member
Former Member

Check for value in script logic

Hi,

I need to write a script that looks at the value on a specific account and, if the amount is negative, performs to *REC statements. In BPC MS I would use the GET keyword, but that does not work in BPC NW. What alternative can I use?

I tried this:

*SELECT(%NETACCOUNT%,[ID],"ACCOUNT","[NETACCT]<>''")

*XDIM_MEMBERSET DATASRC=INPUT
*XDIM_MEMBERSET TIME=%TIME_SET%
*XDIM_MEMBERSET ENTITY=%ENTITY_SET%
*XDIM_MEMBERSET CATEGORY=%CATEGORY_SET%
*XDIM_MEMBERSET CURRENCY=LC
*XDIM_MEMBERSET ACCOUNT=%NETACCOUNT%
*XDIM_MEMBERSET ACCTDETAIL=F_CLO
*XDIM_MEMBERSET CONSOSCOPE=G_NONE

*FOR %ACC%=%NETACCOUNT%
*WHEN [ACCTDETAIL].[F_CLO]
*IS < 0
*REC(FACTOR=-1,DATASRC=INPUT2)
*REC(FACTOR=1,ACCOUNT=ACCOUNT.NETAACT,DATASRC=INPUT2)
*ENDWHEN
*NEXT

but the validation fails saying that [ACCTDETAIL] is an invalid dimension (which it is not, the *XDIM_MEMBERSET at the top on the same dimension validates just fine.

I also tried to use *SELECTCASE but that fails the validation as well.

Can anyone help me with this one??

Thanks,

Arnold

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2013 at 09:48 AM

    Hi,

    I now found this

    if you want to compare record value with something you use *REC(EXPRESSION=(%VALUE%>) ? c : d)

    which I have translated into

    *WHEN ACCOUNT

    *IS *

    *REC(EXPRESSION=%VALUE%<0 ? %VALUE%*-1:0,DATASRC=INPUT2)

    *REC(EXPRESSION=%VALUE%<0 ? %VALUE%:0,ACCOUNT=ACCOUNT.NETACCT,DATASRC=INPUT2)

    *ENDWHEN

    this validates, so all I need to do now is test it...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 18, 2015 at 01:48 PM

    Great post. Very useful replacement for the Get function.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 26, 2016 at 04:31 PM

    Hi Arnold,

    Can you explain how you solved your issue regarding the way to check value in script logic ?

    i tried this solution but face same error as yours : "[Account] is an validation dimension.

    Tks for your helps,

    Regards

    Olivia

    Add a comment
    10|10000 characters needed characters exceeded

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.