Question builder: calculated fields

Let’s say I have a table with sales data of fruits. The columns are fruit name, quantity sold, and total revenue. Is it possible to use the question builder to construct a calculated field that expresses the quantity sold of a particular fruit as a percentage of total quantity sold? It appears that the calculated field functionality can only divide columns? It does not appear to accept arbitrary sql example : i wanted to do a custom field as in SQL: CASE WHEN fruit_name=‘Apple’ then 1 ELSE 0 END

I understand that this is easy to do in SQL but we have non technical business users who would like to be able to do this in the question builder if possible.

Hi @madkap
It’s currently not possible to use SQL in Custom Column (like CASE WHEN), but there’s a request open - go and upvote by clicking :+1: on the first post:
And until PR 10981 gets merged, then you cannot create Custom Field/Column/Expression on aggregated columns either. But it will likely be possible in an upcoming 0.33.x release.

Hi @flamber thanks for the reply and the additional information.