Unable to create custom column

I am trying to create custom column in a table whose source is postgres. using the formula: case([Dispute Status] ="won",Sum([Refund Amount])) where [Dispute Status] is text field and [Refund Amount] is numeric but getting below error

Invalid query: {:query {:aggregation [[nil [nil [[nil ["valid instance of one of these MBQL clauses: :expression, :field"]]]]]]}}.

please help me figure this out

Hey there, can you show the whole query, well formatted and indented, such as

SELECT
   column_a,
   CASE
     WHEN column_a = 'zrt' THEN true ELSE false END
   AS new_column
FROM your_table
WHERE column_a = 'xyz';

In this way you make our life much easier.

I got the solution to my problem . Instead of using case i used SumIf to achieve what i was trying to do.