Sum between tables

Guys, I'm new to appsheets and I have a question.
I have an application to make budgets with a main table with customer data, budget date and total amount, which is related to another table of budget items, the key is the budget ID, in my budget worksheet, I have a "ValorTotal" field where I want to assign the sum of the value of the items related to this budget and I'm not getting it, I would like to know if someone can help me! thanks.

1 1 36
1 REPLY 1

Welcome to AppSheet, glad you have found the platform! 

 

So you have a budget table and an expense table. In the expense table you have a column that says which ID the budget goes with. If that is the case here is something you can do. 

In the total for your budget table you can write this expression SUM(SELECT(expense[cost],[budgetID]=[_THISROW].ID))

In this expression it makes a list of all the costs where the budget ID (in the expense table) matches the budget ID in the budget table and then sums all those values together. I believe this will serve the purpose that you need. I will link below the functions and information I used in my expression so you can learn about them and understand how they work. 

 

As you are new to AppSheet I hope your start with the platform is amazing. Something that helped me was the resources I on appsheettraining.com I linked you to a page that has a lot of the expressions that are used in AppSheet. They have resources both for free and for purchase but at the very least let the free resources help you get started out.

 

Craig

QREW Technologies

SELECT() 

SUM() 

[_THISROW] 

Top Labels in this Space