Skip to Content

conditional executing commands in logic script

Hi All,

One of our scripts calculates different values based on base revenues - discounts, excise, know how fee, unpaid receivables etc.

*XDIM_MEMBERSET TIME = 001.2016

*XDIM_MEMBERSET CATEGORY = BUDGET

*XDIM_MEMBERSET ENTITY = BAS(ENTITY_ALL)

*XDIM_MEMBERSET PRODUCT = BAS(PRODUCT_ALL)

*XDIM_MEMBERSET ACCOUNT = REVENUE_BASE

*WHEN ACCOUNT

*IS REVNEUE_BASE

*REC(FACTOR=([ACCOUNT].[PERC_DISCOUNT_001],[ENTITY].[NO_ENTITY]),ACCOUNT=DISCOUNT_001_VALUE)

*REC(FACTOR=([ACCOUNT].[PERC_DISCOUNT_002],[ENTITY].[NO_ENTITY]),ACCOUNT=DISCOUNT_002_VALUE)

*REC(FACTOR=([ACCOUNT].[PERC_DISCOUNT_900].[ENTITY].[NO_ENTITY]),ACCOUNT=DISCOUNT_900_VALUE)

*REC(FACTOR=([ACCOUNT].[EXCISE_RATE],[PRODUCT].[NO_PRODUCT],[ENTITY].[NO_ENTITY]),ACCOUNT=EXCISE_VALUE)

*REC(FACTOR=([ACCOUNT].[KNOW_HOW_FEE],[PRODUCT].[NO_PRODUCT]),ACCOUNT=KNOW_HOW_VALUE

*ENDWHEN

We would like to calculate values based on values passed by user in executing package box.

Let say, user chose EXCISE_RATE and KNOW_HOW_FEE - we don't want to calculate discounts at all (so existing values will be left in model)

Is it possible to do this using logic script? one of our ideas was change "sides" in script and multiply "factors" per REVENUE_BASE - but it would extend our code a lot... and what's more - it would be allocation, because most of the factors are "one value", and REVENUE_BASE value is per product, entity etc...

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Aug 28, 2015 at 10:45 AM

    Hi Michal,

    If i understand the issue, You can handle it using following members name.

    Rate1: PERC_DISCOUNT_001

    Value: DISCOUNT_001

    Rate2: PERC_DISCOUNT_002

    Value: DISCOUNT_002

    Rate3: PERC_KNOW_HOW_FEE

    Value: KNOW_HOW_FEE

    And, when you choose account values on data manager; for example, DISCOUNT_001,KNOW_HOW_FEE.

    *FOR %P_ACCOUNT% = %ACCOUNT_SET%

    *WHEN ACCOUNT

    *IS REVNEUE_BASE

    *REC(FACTOR=([ACCOUNT].[PERC_%P_ACCOUNT%],[ENTITY].[NO_ENTITY]),ACCOUNT=%P_ACCOUNT%)

    *ENDWHEN

    *NEXT

    Regards.

    Burak

    Add a comment
    10|10000 characters needed characters exceeded

    • Next one - hope it will be working 😊:

      *SELECT(%TS%,[TARGET],ACCOUNT,"[ID]=%ACCOUNT_SET%") // get list of target accounts

      *XDIM_MEMBERSET TIME = 001.2016

      *XDIM_MEMBERSET CATEGORY = BUDGET

      *XDIM_MEMBERSET ENTITY = BAS(ENTITY_ALL)

      *XDIM_MEMBERSET PRODUCT = BAS(PRODUCT_ALL)

      *XDIM_MEMBERSET ACCOUNT = REVENUE_BASE

      *FOR %ACC%=%ACCOUNT_SET% AND %T%=%TS%

      *WHEN ACCOUNT

      *IS *

      *REC(FACTOR=([ACCOUNT].[%ACC%],[ENTITY].[NO_ENTITY]),ACCOUNT=%T%)

      *ENDWHEN

      *NEXT

      Vadim

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.