# How can you minus/subtract as opposed to add?

**URL:** <https://community.glideapps.com/t/how-can-you-minus-subtract-as-opposed-to-add/21074>\
**Category:** Ask for Help\
**Tags:** actions\
**Created:** [January 12, 2021, 1:43pm UTC](https://community.glideapps.com/t/how-can-you-minus-subtract-as-opposed-to-add/21074 "2021-01-12T13:43:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aj42](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@aj42](https://community.glideapps.com/u/aj42)\
**Post date:** [January 12, 2021, 1:43pm UTC](https://community.glideapps.com/t/how-can-you-minus-subtract-as-opposed-to-add/21074/1 "2021-01-12T13:43:53Z")

</div>

I am creating an app to log things. For example, I want to say that I bought 100 widgets on the 12th of January 2021 for $100 and on the 15th of January I sold 50 of them for $70.

I can see how to add things, but how do I subtract it and show that action in a log format?

So Page 1/Tab 1 of the app would be:

Log  
Buy/Sell Stock Date Price  
Buy 100 widgets 12/1/2021 $100  
Sell 50 widgets 15/1/2021 $70

And then on the second page/tab it would show how much I made in a graph.

---

<div class="post-metadata">

**Author:** ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)\
**Post date:** [January 12, 2021, 1:50pm UTC](https://community.glideapps.com/t/how-can-you-minus-subtract-as-opposed-to-add/21074/2 "2021-01-12T13:50:03Z")

</div>

You can do this by:  
having two relations on the second tab. 1 relation for what is bien bought and the second one for what’s being sold/

Then, a rollup that sum what you buy and another one to sum what you sell to the respective relations.  
lastly have math column to subtract both of the rollups.

I hope this helps/
