Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Srinivas
Contributor

Subtract quantity values based on transaction type

Hi Team,

I want to subtract the quantity values based on different type transaction, in final Qty i want to see only positive values.

Actually logic is whatever total CR values minus DR Values for the same i did CR-DR as Qty , in that Qty columns have the negative values bot i don't want see the negative value.

 

Thanks,

Reddy

Thanks,
Srinivas
4 Replies
shiveshsingh
Honored Contributor

Re: Subtract quantity values based on transaction type

May be like this?

If ( CR-DR>=0,CR-DR) as Quantity

Highlighted
Srinivas
Contributor

Re: Subtract quantity values based on transaction type

If we write this expression we are getting the wrong out put.
Thanks,
Srinivas
shiveshsingh
Honored Contributor

Re: Subtract quantity values based on transaction type

Okay, please let me know the expected output from your attached excel file and also the formula that  you are using.

Partner
Partner

Re: Subtract quantity values based on transaction type

What you are trying to do here Subract? or Difference Between?, 

If you want to calculate the difference you can use this If(CR>DR ,CR-DR, DR-CR).

You Know What To Do.