Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

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

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Avoid calculating the sum twice with:

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

8 Replies
Kushal_Chawda

Hi,

Please see the attached file.

This is what you are looking for?

Not applicable

can remove 2 nd if right?

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

amit_saini
Master III
Master III
Author

Kush,

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

Thanks,

AS

jonathandienst
Partner - Champion III
Partner - Champion III

Avoid calculating the sum twice with:

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

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
amit_saini
Master III
Master III
Author

Yes for sure you can do this.

Thanks,
AS

jagan
Partner - Champion III
Partner - Champion III

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.

amit_saini
Master III
Master III
Author

Thanks Jonathan!

looks to me this is right approach.

Thanks,
AS

amit_saini
Master III
Master III
Author

Thanks Jagan