cancel
Showing results for 
Search instead for 
Did you mean: 

URGENT HELP PLEASE: Script Logic *Rec destination Dimension depends on a variable property of Other Dimension

Former Member
0 Kudos

Hi BPC Team,

I need you advice in logic script for below scenario:

I have 3 Positions with 9 employees.

3 employees are in Position 586

5 employees are in Position 588

1 employees are in Position 589

I have created Position as Dimension, Employee as another dimension with Position as Property.

I have total 10 dimension for this Model and updated Salary level for each positions with all other dimensions DUMMY even Employee as NO_EMP

Position 586 Salary 100000

Position 588 Salary 125000

Position 589 Salary 80000

I want script logic to post Each employee with respective salary amount based on Position

3 employees are in Position 586 Salary of 100000 each

5 employees are in Position 588 Salary of 125000 each

1 employees are in Position 589 Salary of 80000 each


*XDIM_MEMBERSET CHANGE_LEDGER = CL_NONE

*XDIM_MEMBERSET COSTCENTRE = CC_NONE

*XDIM_MEMBERSET LOCATION = LO_NONE

*XDIM_MEMBERSET PROJECT = PJ_NONE

*XDIM_MEMBERSET RPTCURRENCY = LC

*XDIM_MEMBERSET TIME = 2016.INPUT

*XDIM_MEMBERSET VERSION = ACTUAL


*SELECT(%FIN2%,[ID],GRADE,"[ID] =586','588',’589’")

*XDIM_MEMBERSET GRADE = %FIN2%

*XDIM_MEMBERSET ACCOUNTHR = 10000000

*XDIM_MEMBERSET EMPLOYEE = NO_EM

*SELECT(%EMP1%,[ID],EMPLOYEE,"[GRADENO] = '%FIN2%'")  --> System picks 9 employees

*WHEN ACCOUNTHR

*IS *

    *FOR %FIN% = %FIN2%

          *FOR %EMP% = %EMP1%

              *WHEN GRADE

              *IS %FIN%

                    *WHEN EMPLOYEE

                    *IS NO_EMP

                        *BEGIN

                              *REC(FACTOR = 1,EMPLOYEE =%EMP%, GRADE =%FIN%)

                        *END

                    *ENDWHEN

              *ENDWHEN

          *NEXT

    *NEXT

*ENDWHEN

System is creating each position for all emplolyees of Select Statment. i.e 9 employees for position 586. 588 and 589, Which is wrong.

Problem is with *REC(FACTOR = 1,EMPLOYEE =%EMP%, GRADE =%FIN%)

I am expecting EMPLOYEE to have [EMPLOYEE].[GRADENO] = %FIN%.

Record Statement destination employee has to be only employees which belong to respective Position.

My *REC statement destination dimension employee depends on Grade ID, which is a Property in Employee as GRADENO.

Regards,

Tej

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi Tej,

Not 100% clear!

Please provide full info:

"I have total 10 dimension for this Model and updated Salary level for each positions with all other dimensions DUMMY even Employee as NO_EMP"

What do you mean by DUMMY? May be CL_NONE, CC_NONE, etc...?

Please provide the full list!


Vadim

P.S. And your POSITION is GRADE dimension?

Former Member
0 Kudos

Hi Vadim,

I am working on HR model.

Here is the details attached.

Employee Dimsension

Position Dimension

Salary Positionwise upload file to Employee Model.

Once al these data in BPC,

I want script logic to create salary entries in Employee Model for each employee based on their position.

I am using the below script, which is not giving the required resutls?

*XDIM_MEMBERSET CHANGE_LEDGER = CL_159

*XDIM_MEMBERSET COSTCENTRE = CC_NONE

*XDIM_MEMBERSET LOCATION = LO_NONE

*XDIM_MEMBERSET PROJECT = PJ_NONE

*XDIM_MEMBERSET RPTCURRENCY = LC

*XDIM_MEMBERSET TIME = 2016.INPUT

*XDIM_MEMBERSET VERSION = VE_ACTUAL

*SELECT(%FIN2%,[ID],GRADE,"[ID] ='586','589','588'")

*FOR %FIN% = %FIN2%


*XDIM_MEMBERSET GRADE = %FIN%

*XDIM_MEMBERSET ACCOUNTHR = 10000000

//*XDIM_MEMBERSET EMPLOYEE = NO_EMP

*XDIM_FILTER EMPLOYEE = [EMPLOYEE].properties("GRADENO") = "%FIN%"

*XDIM_ADDMEMBERSET EMPLOYEE = NO_EMP

//*SELECT(%EMP%,[ID],EMPLOYEE,"[GRADENO] = '%FIN2%'")

*FOR %EMP% = EMPLOYEE

*WHEN EMPLOYEE

*IS  NO_EMP

*WHEN GRADE

*IS %FIN%

*BEGIN

*REC(EXPRESSION = 1*([EMPLOYEE].[NO_EMP],[ACCOUNTHR].[10000000]),EMPLOYEE=%EMP%,GRADE=%FIN%)

*END

*ENDWHEN

*ENDWHEN

 

*NEXT

*NEXT

*COMMIT

This is the result in UJKT

Former Member
0 Kudos

Sorry, missed some attachments

Former Member
0 Kudos

Hi Vadim,

I have updated with the data, if you have time could you please look into my script logic and help me.

Regards,

Tej

former_member186338
Active Contributor
0 Kudos

I will explain you an idea, and you will do the rest yourself

You have some values stored for each grade with some dummy other members.

For each grade you want to copy this value to all employees having the property GRADENO - this grade.

Use FOR/NEXT loop to loop all required grades.

Inside loop use *RUNALLOCATION like:

*FOR %GR%=586,589,588

*XDIM_MEMBERSET ...=... //XDIM's have to be repeated in each loop

*XDIM_MEMBERSET GRADE=%GR%

*RUNALLOCATION

*FACTOR=1 //just to copy

*DIM EMPLOYEE WHAT=NO_EMP; WHERE=[GRADENO]=%GR% //where by property!

...

*ENDALLOCATION

*NEXT

Vadim

Former Member
0 Kudos

Hi Vadim,

Thanks man, it worked, but error like this is coming

UJK_EXECUTION_EXCEPTION:Runtime error Could not generate the object; the class \PROGRAM=

So i have to reduce the size of my Allocation value or has to use your other suggested solution of RUNLOGIC_PH BADI.

Need your expert advice in this too.

I need to update the Below record from

CHANGE_LEDGEREMPLOYEELOCATIONPROJECTRPTCURRENCYVERSIONTIMECOSTCENTREACCOUNTHRGRADESIGNEDDATA
CL_159NO_EMPLO_NONEPJ_NONELCVE_ACTUAL2016.INPUTCC_NONE10000000586170250
CL_159NO_EMPLO_NONEPJ_NONELCVE_ACTUAL2016.INPUTCC_NONE10000000587199301

To this entry

CHANGE_LEDGEREMPLOYEELOCATIONPROJECTRPTCURRENCYVERSIONTIMECOSTCENTREACCOUNTHRGRADESIGNEDDATA
CL_15910000179LO_NONEPJ_NONELCVE_ACTUAL2016.INPUT74910000000586170250
CL_15910002853LO_NONEPJ_NONELCVE_ACTUAL2016.INPUT74810000000587199301

With Run Allocation logic i have succsfully got employee record.

Now to update the cost centre, is there any way we can update in same Run Allocation.

I have used  below logic which is not working and giving below records.

Script Used to update Cost center as per employee master data

*XDIM_MEMBERSET CHANGE_LEDGER = CL_159

*XDIM_MEMBERSET LOCATION = LO_NONE

*XDIM_MEMBERSET PROJECT = PJ_NONE

*XDIM_MEMBERSET RPTCURRENCY = LC

*XDIM_MEMBERSET TIME = 2016.INPUT

*XDIM_MEMBERSET VERSION = VE_ACTUAL

*XDIM_MEMBERSET ACCOUNTHR = 10000000

*WHEN EMPLOYEE

*IS *

*WHEN GRADE

*IS *

*WHEN COSTCENTRE

*IS  CC_NONE

*REC(FACTOR = 0, COSTCENTRE = "CC_NONE")

*REC(FACTOR = 1, COSTCENTRE = EMPLOYEE.COSTCENTER)

*ENDWHEN

*ENDWHEN

*ENDWHEN

*COMMIT

Can we use

*DIM COSTCENTRE WHAT CC_NONE WHERE [ID] = "[EMPLOYEE].[COSTCENTER]

or

the way i am updating the data is correct?

Regards,

Tej

former_member186338
Active Contributor
0 Kudos

"*DIM COSTCENTRE WHAT CC_NONE WHERE [ID] = "[EMPLOYEE].[COSTCENTER]" - impossible!

"the way i am updating the data is correct?" - more or less correct, just remove useless:

*WHEN EMPLOYEE

*IS *

*WHEN GRADE

*IS *

and

*COMMIT

Vadim

Answers (0)