Sum whit EnumList Filter

Buonasera, 

come posso sommare i valori di un'altra colonna dopo aver filtrato i dati (text) proveniente da enumlist

filter(Viaggio,in([_THISROW],[Chi deve pagare?]))

Devo sommare questi numeri  

Screenshot 2024-02-25 alle 20.54.15.png

Screenshot 2024-02-25 alle 20.56.16.png

Screenshot 2024-02-25 alle 20.55.53.png

Screenshot 2024-02-25 alle 20.56.07.png

  

Grazie a tutti

 

 

Solved Solved
0 4 71
1 ACCEPTED SOLUTION

Hi @Peppissimo 

What about, in the table "Persone", using this expression: 

SELECT(Viaggio[€ a testa],
  CONTAINS([Chi deve pagare?],[_THISROW].[Persone])
)

equivalent to:
SELECT(Viaggio[€ a testa],
  CONTAINS([Chi deve pagare?],[_THISROW])
)

Or, alternatively:

SELECT(Viaggio[€ a testa],
  IN([_THISROW].[Persone],[Chi deve pagare?])
)

equivalent to:
SELECT(Viaggio[€ a testa],
  IN([_THISROW],[Chi deve pagare?])
)

 For reference:

SELECT() - AppSheet Help

CONTAINS() - AppSheet Help

IN() - AppSheet Help

View solution in original post

4 REPLIES 4

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Peppissimo 

You may prefer asking your question in English for a faster response 🙂

I guess this is like a collective pot app.

If so, you need for each expense to calculate how many people you have, and then calculated the "share per person". You would have these columns:

[_numberOfPerson] and [_sharePerPerson]

I don't read Italian, but I think you made it already.

Then, use the list of people (should be in another table) and calculate with:

SUM([Related Expense][_sharePerPerson])

 I'm using here a simple expression wich is called a dereference expression. 

For reference: Dereference expressions - AppSheet Help

 

Hi Aurelien,

sorry for my english

i insert this expression but maybe i have wrong something, or maybe I don't know where to put it

I can't make it work.

Now i tried whit this in Table "Persone":

if(CONTAINS([Cosa devi pagare],[Persone])=[Persone],(sum(Viaggio[€ a testa])),0)

but sum all of column, whitout filter

Thanks

Hi @Peppissimo 

What about, in the table "Persone", using this expression: 

SELECT(Viaggio[€ a testa],
  CONTAINS([Chi deve pagare?],[_THISROW].[Persone])
)

equivalent to:
SELECT(Viaggio[€ a testa],
  CONTAINS([Chi deve pagare?],[_THISROW])
)

Or, alternatively:

SELECT(Viaggio[€ a testa],
  IN([_THISROW].[Persone],[Chi deve pagare?])
)

equivalent to:
SELECT(Viaggio[€ a testa],
  IN([_THISROW],[Chi deve pagare?])
)

 For reference:

SELECT() - AppSheet Help

CONTAINS() - AppSheet Help

IN() - AppSheet Help

Both are the right solution, I only added SUM to get the final result.
I learned something thanks to you 😃

Top Labels in this Space