Skip to Content

Asking for dimension member A value and take Dimension member B value based on A. SCRIPT LOGIC

Hello experts,

I have a question related Scripto logic. I have been reading that to ask for a dimension member value, you need to use Ternary expression. A>B ? C : D.

Lets say I have the dimensions Category, Account, Time, Entity, Currency, Worker, Company Code and SUPNOM.

SUPNOM has let´s say 2 members:Salary and Company. Company makes reference to Company Code.

The ratio of Company its for the user to capture the company code for the worker it could change, is very changable so could not be an attribute of the dimension worker.

My question is the next.

How to check the company code based on the %value% and then take the Salary value,



*IS Company

*REC (EXPRESSION= %VALUE%==1000? (HERE i wanto to set the value contained in Salary, not the 1000), 0

How to take the value I want instead of the value 1000?

Thanks for the posts.

Best Regares.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 16, 2016 at 08:34 AM

    Sample of slow script:

    *IS *
    *REC(EXPRESSION=([SUPNOM].[Company]==1000) ? %VALUE% : 0, COMPANY=1000)
    *REC(EXPRESSION=([SUPNOM].[Company]==1100) ? %VALUE% : 0, COMPANY=1100)
    *REC(EXPRESSION=([SUPNOM].[Company]==1200) ? %VALUE% : 0, COMPANY=1200)
    ... //for all possible companies

    each line will check the current record...

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 16, 2016 at 08:17 AM

    In general it's a bad idea to store member ID (company code) as a signeddata value. Script logic is badly supporting the logic required (can be done but will be very slow with a huge loop).

    If you still want to use the described logic - write a custom logic badi or write back badi.

    Add comment
    10|10000 characters needed characters exceeded