Sum of the value from a table

Hello the team,

I have a table “wallet” where users can create different wallet, and another table “expense” where users can add expense depending the wallet, I would like to use the fonction SUM to all expense of a wallet in table “expense” and add the number in the table wallet…
Could you help me please?

Solved Solved
1 4 228
1 ACCEPTED SOLUTION

Hi @sOAP_WKC

Did you have a look to the documentation provided ?

This expression: REF_ROWS(“Expense”, “Category”)
goes with the column commonly named “Expenses”.

Nonetheless, I understand you might get trouble at getting it, as more often it is generated with the name “Related Expenses”, and it has been shortened into “Expenses” in the sample app…

So, the expression you are looking for should be, if you didn’t change it, and assuming you added (in the table Expenses) a column [Amount] with a type Decimal or Price:
SUM([Expenses][Amount])
Please note this expression has its place in the table “Wallet/Category”, as said previously !

View solution in original post

4 REPLIES 4

Aurelien
Google Developer Expert
Google Developer Expert

Hi @sOAP_WKC

Welcome to the community !

Here:
Assuming:

  • WALLET is a table,
  • EXPENSE is another table, and include a column with Ref type, referencing to WALLET

In WALLET Table, add a virtual column with this expression:
SUM([Related EXPENSEs][Amount])

For reference:

Hello Aurelien,

Thank you for your help, I used the App template Client Expenses to build my app…

In the table named category (wallet for me) I have a ref for a table icon where the user can pick an Icon when he create a new wallet, I also have a column “expenses” who is type list and ref of the table “Expense” … the app formula is : REF_ROWS(“Expense”, “Category”)

Hi @sOAP_WKC

Did you have a look to the documentation provided ?

This expression: REF_ROWS(“Expense”, “Category”)
goes with the column commonly named “Expenses”.

Nonetheless, I understand you might get trouble at getting it, as more often it is generated with the name “Related Expenses”, and it has been shortened into “Expenses” in the sample app…

So, the expression you are looking for should be, if you didn’t change it, and assuming you added (in the table Expenses) a column [Amount] with a type Decimal or Price:
SUM([Expenses][Amount])
Please note this expression has its place in the table “Wallet/Category”, as said previously !

Thank you Aurelien, its work!!
I dindnt used AppSheet for a long time, same for my English, I was a bit lost. ^^

Top Labels in this Space