8 Replies Latest reply: Jul 7, 2015 2:08 AM by Amit Saini

# Net Calulation Help

Hi Folks,

Below is my condition for the Net cal:

Formula:

If MSEG-SHKZG = H, MSEG-DMBTR is negative (i.e. MSEG-DMBTR is 9.207,87 the value to calculate with is –9.207,87)

If MSEG-SHKZG = S, MSEG-DMBTR is positive

Get for each entry selected MSEG-DMBTR and convert to either negative or positive value.

Calculate the converted values to a net total.

1. I.e. -100 + 50 = -50

I'm trying for something like below for the Calculation :

if(Debit_Credit_Indicator='H',- sum(Amt_Local_Curr), if(Debit_Credit_Indicator='S',sum(Amt_Local_Curr)))

Any suggestions to calculate in the best way???

Thanks,

AS

• ###### Re: Net Calulation Help

Hi,

Please see the attached file.

This is what you are looking for?

• ###### Re: Net Calulation Help

Kush,

In ur case output should be +500 not -300.

Thanks,

AS

• ###### Re: Net Calulation Help

can remove 2 nd if right?

if(Debit_Credit_Indicator='H',- sum(Amt_Local_Curr),sum(Amt_Local_Curr))

• ###### Re: Net Calulation Help

Yes for sure you can do this.

Thanks,
AS

• ###### Re: Net Calulation Help

Avoid calculating the sum twice with:

=Sum(If(Debit_Credit_Indicator='H', -1, 1) * Amt_Local_Curr)

• ###### Re: Net Calulation Help

Hi,

Try like this using set analysis

=-sum({<Debit_Credit_Indicator={'H'}>} Amt_Local_Curr) + sum({<Debit_Credit_Indicator={'S'}>}Amt_Local_Curr)

Hope this helps you.

Regards,

Jagan.

• ###### Re: Net Calulation Help

Thanks Jagan

• ###### Re: Net Calulation Help

Thanks Jonathan!

looks to me this is right approach.

Thanks,
AS