Skip to main content
Question

Help with formulas

  • December 18, 2017
  • 0 replies
  • 25 views

i need a formula that uses the (total of field a) minus (field b) instead of (field a) - (field b) which quick base only allows me to do, but when i view my table it shows a total. i need this set up based all on separate fields too. Please can someone help :(
This topic has been closed for replies.

Forum|alt.badge.img+17
  • Community Moderator
  • December 18, 2017
Hi Demi,

What you are looking to do is going to require more than just a formula. In Quick Base a formula is focused to do math just on data that is stored in fields in one particular record. So math like (field a) - (field b) is possible since both pieces of data exist on the same record. Instead when you are looking to do math for a value like the total of all records in field A that data doesn't exist by default in a place where the formula can reference it. 

Instead what typically needs to happen is you need to leverage a relationship in order to make it possible for data to be summarized and then made available for analysis. So for example if I had a set up where I had two tables Projects and Tasks and I realized I wanted to be able to see on each Task record how much the rest of the Projects Costs are minus the current task. So I have the cost of the current task in my record on the Tasks table but I do not have the total cost of all tasks, that is what I need to get to make this formula possible.

In this instance what I would do is go into the relationship between Projects and Tasks and add a summary field to summarize the Cost field from all Task records to their related Project. This way each Project record gets a field that shows the cost of all the Tasks assigned to it. Now to get that information back down into each Task I need to go into the relationship between Projects and Tasks and instead of creating a summary field I now create a look up field that pulls down the new Total Cost of All Tasks field to display on each Task record. This means I now have the Total Cost of All Tasks displaying on each Task. This way I can now do. [Total Cost of All Tasks]-[Current Task Cost] to get my new formula. In order to do this formula there has to be a place where this total is being summarized up to another table and then passed back down. 

I hope this information helps point you in the right direction Demi. 

  • Author
  • Quickbase Alumni
  • December 19, 2017
Thank you - this is very helpful! I'll give it another go :)

Forum|alt.badge.img+17
  • Community Moderator
  • December 19, 2017
Excellent, and let me know if you have any further questions. These summary calculations can be a little tricky to set up when you are first learning them but can be very helpful.