on 12-15-2016 10:46 PM
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,
i.e.
*When SUPNOM
*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.
Sample of slow script:
*XDIM_MEMBERSET COMPANY=COMP_NONE
*XDIM_MEMBERSET SUPNOM=Salary
*WHEN COMPANY
*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
*ENDWHEN
each line will check the current record...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vadim,
Thank you very much for the code, one last question about the anwer. Is it possible to make it this way?
XDIM_MEMBERSET COMPANY= A
*WHEN SUPNOM
*IS Company
*REC(EXPRESSION=(%Value%==1000) ?[SUPNOM].[Salary] : 0, COMPANY=1000)
*REC(EXPRESSION=(%Value%==1100) ?[SUPNOM].[Salary] : 0, COMPANY=1100)
*REC(EXPRESSION=(%Value%==1200) ?[SUPNOM].[Salary] : 0, COMPANY=1200)
*NEXT
I ask bc salary is just one value I need to save in the other company. The functional requirement is the next:
Payroll Budget must be in Company A and Company B, C or D, depend on the employee. The salary is not just one dimension member it is 10 to 17 members. Each employee belongs to company B, C or D, it is identified by a Value.
So I was planning on doing a for:
XDIM_MEMBERSET COMPANY= A
*WHEN SUPNOM
*For %BENEFIT%= B1, B2, B3..Bn
*IS Company
*REC(EXPRESSION=(%Value%==1000) ?[SUPNOM].[Salary] : 0, COMPANY=1000)
*REC(EXPRESSION=(%Value%==1100) ?[SUPNOM].[Salary] : 0, COMPANY=1100)
*REC(EXPRESSION=(%Value%==1200) ?[SUPNOM].[Salary] : 0, COMPANY=1200)
*next
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.