Problem in Sums

Hi, i wonder what i am doing wrong with the next formula.
What i am trying to do is to sum prices (Importe) of the rows where PAGO = "Red" or "Yellow" condition.
But i am receiving this error message in this formula 
SUM (SELECT (MOVIMIENTOS[IMPORTE], ([PAGO]="Red", [PAGO]="Yellow")))

JPAN_0-1664893585849.pngJPAN_1-1664893590795.png

JPAN_2-1664893603402.png

 

0 3 51
3 REPLIES 3

SUM (SELECT (MOVIMIENTOS[IMPORTE], AND(([PAGO]="Red", [PAGO]="Yellow"))))]

You missed the AND()

Hi thanks for your reply, i am getting the same error message, 
"The expression is valid but its result type 'Price' is not one of the expected types: Yes/No"
SUM (SELECT (MOVIMIENTOS[IMPORTE], AND(([PAGO]="Red"), ([PAGO]="Yellow"))))
JPAN_0-1664895964042.png

 



EDIT: i tried this solution (https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Select-Function-Error/m-p/434762) with the ANY function but i am getting a SUM error.

JPAN_0-1664897232611.png

 

I foud out that i dont have to put that formula in the Slice Condition. Instead i create a Virtual Column in the table Movimientos wich is goes like this:

SUM(SELECT (MOVIMIENTOS[IMPORTE], OR(([PAGO]="Red"), ([PAGO]="Yellow"))))

And it worked! many thanks for your help with the formula! 


Top Labels in this Space