Hi all,
I am an RPA-Developer, but new to AppSheet. I have a question regarding calculating/computing a sum of values from a list.
In the following statement I receive the sum of all transaction related to ALL customers:
DECIMAL(SUM(SELECT(TRANSACTIONS[Transaktionsbetrag], TRUE)))
I need only the sum of all transactions for a single customer.
I have referenced the two table [CLIENT] and [TRANSACTIONS]. In the App I managed to get the detail of transactions for each client in the client view (as List). Now I want to add a computed column to add the summ of all the transactions related to this client.
Many thanks for the help!!
BR. - Robert
Solved! Go to Solution.
Welcome to the community!
You simply need to change this expression to select transaction rows for the client like the below. I will assume you have a column on your Transaction table named โClientโ and that you are assigning this sum to a column in your Client table:
DECIMAL(SUM(SELECT(TRANSACTIONS[Transaktionsbetrag], [Client] = [_THISROW].[Client])))
The article below will help with more complex SELECT() expressions:
Welcome to the community!
You simply need to change this expression to select transaction rows for the client like the below. I will assume you have a column on your Transaction table named โClientโ and that you are assigning this sum to a column in your Client table:
DECIMAL(SUM(SELECT(TRANSACTIONS[Transaktionsbetrag], [Client] = [_THISROW].[Client])))
The article below will help with more complex SELECT() expressions:
When you have a relationship between these tables and the Client table is probably the parent, you can read it like DECIMAL(SUM([Related Transactions][Transaktionsbetrag]))
With this formula you donโt need to read the whole Transactions table. You just need to read the virtual related table.
User | Count |
---|---|
43 | |
28 | |
23 | |
14 | |
14 |