cancel
Showing results for 
Search instead for 
Did you mean: 

Script REC Expression

former_member220155
Participant
0 Kudos

Hi Guys,

I have requirement to Copy data from one paycycle (Prev) to  another Paycycle(Current) when Flag=1 otherwise it shouldn't do anything.

User input from the Input template

CostcenterHRACCTSKFPaycycleMeasure(Sign data)
633014REOCCURINGSK2012015.09.191
633014REOCCURINGSK2032015.09.191
633014SPPYSK2012015.09.19-25%
633014SPPYSK2032015.09.19-25%
633014RECOORURINGSK2012015.09.190
633014SPPYSK2012015.09.1950%

I want to read SPPY value when REOCCRING =1 from Paycyle 2015.09.19(PREV) to COPY Paycycle 2015.10.03 (Current). If REOCCURING =0 SPPY value shouldn't COPY . it shouldn't do anything.

I have Propertys PREV and CURR on Paycycle dimension my scope is resticting to PREV diemension.

I am attching the script which i developed, my scirpt is copying always even RECOOYRING=0 can anyone help how to acheve this one.

My expected outout should be like this

CostcenterHRACCTSKFPaycyclesigndata
633014REOCCURINGSK2012015.10.031
633014REOCCURINGSK2032015.10.031
633014SPPYSK2012015.10.03-25%
633014SPPYSK2032015.10.03-25%

Accepted Solutions (1)

Accepted Solutions (1)

david_ings
Explorer
0 Kudos

Hi,

Can you try the following syntax when performing an "IF" style statement on your REC line?

E.g.

*REC(EXPRESSION=%VALUE%>0?%VALUE%:0,PAYCYCLE=%whatever%)

So the above line is saying if the value of the record in scope is greater than zero, then move this value to your specified paycycle, otherwise zero.

If your second line was meant to multiply by SPPY if REOCCURING> 0, then something like this could work

*REC(EXPRESSION=%VALUE%>0?%VALUE%*([HRACCT].[SPPY]):0,PAYCYCLE=etc etc)

David

former_member186338
Active Contributor
0 Kudos

Hi David,

Writing zero ":0" is not equivalent of doing nothing

To do nothing you have to write destination over destination! Like:

: [PAYCYCLE].[...], ....

And zero check is done like:

%VALUE%==0 ? ....

Vadim

david_ings
Explorer
0 Kudos

Thanks Vadim, good points.

David

former_member220155
Participant
0 Kudos

Thanks Vadim.

how do i change destination , script is always accepting only one destiantion for two conditions.

*REC(EXPRESSION=(%VALUE%==0)?    :%VALUE%, PAYCYCLE=%GV_ASSU_CURR%)

If it is 0 it shouldn't write anything back to database not zero also as you said. Can you please share any syntax which will allow two diffrent destantaions in my case like  %GV_ASSU_CURR% and %GV_ASSU_PREV%

former_member186338
Active Contributor
0 Kudos

You can't change destination, but you can write destination over destination - equivalent of doing nothing:

*REC(EXPRESSION=(%VALUE%==0) ? [PAYCYCLE].[%GV_ASSU_CURR%] : %VALUE%, PAYCYCLE=%GV_ASSU_CURR%)

Vadim

Answers (0)