cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Script logic issue (with the condition)

Former Member
0 Kudos
158

Hi,

We are wrtiting a script logic to ensure that if a GL account i.e, 221050 total /net value is greater than zero then should  all therecords should goto 221050A , else if the total is lesser than zero then all the transaction records should goto 221050L.

The below is the script logic written, but the logic is checking each record instead of  the total net balance and is posting to assets and liabilities.

*WHEN ACCOUNT

*IS 221050

*REC(EXPRESSION=%VALUE%>0 ? %VALUE% : 0, ACCOUNT=221050A)

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

*ENDWHEN

*WHEN ACCOUNT

*IS 221050

*REC(EXPRESSION=%VALUE%<0 ? %VALUE% : 0, ACCOUNT=221050L)

*REC(EXPRESSION=%VALUE%<0 ? 0 : %VALUE% )

*ENDWHEN

For Instance if  In have 2 records, with value  +50 and  -150, the logic should take the total as -100(I.e, 50+(-150)=-100) and based on the logic since  it is less than zero all the 2  transactions should goto 221050L.

Instead now system posts +50 in 221050A and -150 in 221050L.

Could you please let me know how to correct the same in the script.

Kindly advice.


Regards,

Shilpa

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member186338
Active Contributor
0 Kudos

Sorry, but 221050 is a parent account?

And you incorrectly created this post - no answer required!

Vadim

Former Member
0 Kudos

Hi Vadim,

221050 is not a parent account.Its a base level member.

Please suggest.

Regards,

Shilpa

former_member186338
Active Contributor
0 Kudos

OK, Arnold is correct - first SUM all intco into some intco and then analyze the sign of result! The question is - to what intco you want to write the result?

Former Member
0 Kudos

We typically create a DUMMY element in all dimensions and use the intco DUMMY for this purpose.

Former Member
0 Kudos

Hi Arnold/ & Vadim,

Thanks for the very swift support.

I have created a dummy interco member.

But, I have very limited idea on Scripts and hence could you please help me with the script logic to find the sum and post it Dummy Intco and then the condition to to check  if the total in Duumy intco  if Debit then to 221050A else to 2201050L.

Kindly help.

Regards,

Shilpa

former_member186338
Active Contributor
0 Kudos

Start trying yourself...

Vadim

Former Member
0 Kudos

Hi Shilpa,

do these two transactions differ on any other dimension? I.e. are they on different members in any dimension apart from the account?

BR,

Arnold

Former Member
0 Kudos

Hi Arnold,

Yes the line items are different. Please find the below screen shot.

The requirement is, to check the total i.e, -2973755.5000 of the account 221000,  as  the total is negative, so both the line items should goto GL account 221000L.

We have included this condition as in ECC a single account is in two nodes based on debit/credit balances.

Please suggest.

Regards,

Shilpa

Former Member
0 Kudos

Hi Shilpa,

The only solution I have found is a bit of a workaround. Create either a script or a rule that saves the total amounts across all intco members onto a dummy element. Then in your script check the amount on this dummy element.

BR,
Arnold

former_member186338
Active Contributor
0 Kudos

Yes, in general the first thing that have to be done is to calculate the result in one of the target base member independent on sign (just sum!). Then - analyze result for sign and move it to another member if required.

Vadim