How to do a subtraction from col a to col b

Solved
Frequent Contributor
Posts: 80

How to do a subtraction from col a to col b

Hi I have a table that looks like this
Id. DollarA. Dollar B
1. 10. 45
2. 50. 35
3. 20. 25
I need it to look like this
. DollarA. Dollar B. DIFF
1. 10. 45. 35
2. 50. 35. 15
3. 20. 25. 5

Thanks for assistance

Accepted Solutions
Solution
‎07-17-2016 10:17 PM
Valued Guide
Posts: 533

Re: How to do a subtraction from col a to col b

Looks like you need the absolute value of the difference:

diff=abs(a-b);

- Jan.

All Replies
Super User
Posts: 23,683

Re: How to do a subtraction from col a to col b

Diff = b - a;

Solution
‎07-17-2016 10:17 PM
Valued Guide
Posts: 533

Re: How to do a subtraction from col a to col b

Looks like you need the absolute value of the difference:

diff=abs(a-b);

- Jan.

Frequent Contributor
Posts: 80

Re: How to do a subtraction from col a to col b

Thank you -Jan
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
• 3 replies
• 427 views
• 0 likes
• 3 in conversation