# Math Column Connection

**URL:** <https://community.glideapps.com/t/math-column-connection/32315>\
**Category:** Ask for Help\
**Created:** [September 25, 2021, 4:51pm UTC](https://community.glideapps.com/t/math-column-connection/32315 "2021-09-25T16:51:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Merisanu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kevin_merisanu/32/32146_2.png) [@Kevin\_Merisanu](https://community.glideapps.com/u/Kevin_Merisanu)\
**Post date:** [September 25, 2021, 4:51pm UTC](https://community.glideapps.com/t/math-column-connection/32315/1 "2021-09-25T16:51:33Z")

</div>

Hey Glide community!

I have a column set up for dollars spent and dollar budget. One is in the Categories sheet and one is in the Items sheet - however when I set up the Math column it only allows me to relate it to the columns in that sheet - when I need to relate it to the Items sheet \> Cost [$$]

Any help and ideas are always appreciated! 🙂

 ![screencapture-go-glideapps-app-6I7UNg9JlZUtYdkNl0LK-data-2021-09-25-12_51_12](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/8/78fd101b0955abdf0eb88b3668c0003394def247.png)  
 ![screencapture-go-glideapps-app-6I7UNg9JlZUtYdkNl0LK-data-2021-09-25-12_50_53](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/f/0f77d9d2da229a79bb00d7245bc561318487275f.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 25, 2021, 5:16pm UTC](https://community.glideapps.com/t/math-column-connection/32315/2 "2021-09-25T17:16:42Z")

</div>

It’s not clear here what you are trying to do. Are you trying to subtract a value in one table from a value in another table? To do that, you’d need to first create a single relation between the two tables, and then use a lookup column to import the value you need from one table to the other.

But looking at your screenshots, it’s not immediately obvious how the two tables are related.

Perhaps if you can explain what your end goal is here?

---

<div class="post-metadata">

**Author:** ![Kevin\_Merisanu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kevin_merisanu/32/32146_2.png) [@Kevin\_Merisanu](https://community.glideapps.com/u/Kevin_Merisanu)\
**Post date:** [September 25, 2021, 10:00pm UTC](https://community.glideapps.com/t/math-column-connection/32315/3 "2021-09-25T22:00:54Z")

</div>

Hi @Darren_Murphy

Thanks so much for the response – sorry for my lack of clarity 😄

> Are you trying to subtract a value in one table from a value in another table?

Yes! From my Categories \> Budget Remaining [$$] from the Items \> Cost [$$] - example, if my budget is $100 and I bet $20, I would have $80 leftover

> To do that, you’d need to first create a single relation between the two tables, and then use a lookup column to import the value you need from one table to the other.

I will try that out now! May need some guidance / I will be back here with I’m sure an issue or two once I try this out

The two tables are related as such

Items:  
Name of Bet  
Units Bet  
Dollars Bet  
Category (related to the Categories sheet)

Category:  
Name of Sportsbook  
Unit Budget  
Dollar Budget  
Budget Remaining (Units)  
Items Total

---

<div class="post-metadata">

**Author:** ![Kevin\_Merisanu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kevin_merisanu/32/32146_2.png) [@Kevin\_Merisanu](https://community.glideapps.com/u/Kevin_Merisanu)\
**Post date:** [September 25, 2021, 10:08pm UTC](https://community.glideapps.com/t/math-column-connection/32315/4 "2021-09-25T22:08:55Z")

</div>

How do I go about creating a single relation between the two tables? Not sure the process

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 26, 2021, 3:09am UTC](https://community.glideapps.com/t/math-column-connection/32315/5 "2021-09-26T03:09:56Z")

</div>

Okay, so you’d add a [Single Relation](https://docs.glideapps.com/all/reference/data-editor/computed-columns/relation-column#single-relations) column to your Categories table, that joins the Category Name in that table to the Category Name in the Items table.  
Then create a [Lookup](https://docs.glideapps.com/all/reference/data-editor/computed-columns/lookup-column) column that fetches the value you need from the Items table via that relation.  
You can then use that second column in your math formula.

But your table structure still looks a little odd to me - what happens when you have multiple users, how do you know which bets apply to which users?

---

<div class="post-metadata">

**Author:** ![Kevin\_Merisanu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kevin_merisanu/32/32146_2.png) [@Kevin\_Merisanu](https://community.glideapps.com/u/Kevin_Merisanu)\
**Post date:** [September 27, 2021, 7:37pm UTC](https://community.glideapps.com/t/math-column-connection/32315/6 "2021-09-27T19:37:39Z")

</div>

Hey @Darren_Murphy so sorry I didn’t see this !!

Thanks so much for the response

> But your table structure still looks a little odd to me - what happens when you have multiple users, how do you know which bets apply to which users?

This is a part that kind of puzzles me - am I able to set certain columns to be user specific? Some are greyed out but not sure if that’s because I’m not upgraded.

Basically the user would be able to add all their bets, and budgeting for units and dollars - they just cannot add or edit Sportsbooks.

> Okay, so you’d add a [Single Relation](https://docs.glideapps.com/all/reference/data-editor/computed-columns/relation-column#single-relations) column to your Categories table, that joins the Category Name in that table to the Category Name in the Items table.

I will try this out now and reply shortly!

> Then create a [Lookup](https://docs.glideapps.com/all/reference/data-editor/computed-columns/lookup-column) column that fetches the value you need from the Items table via that relation.  
> You can then use that second column in your math formula.

Will give this a go as well - lets hope I’m smart enough to figure it out 😅
