Shua42
Databricks Employee
Databricks Employee

Hi @dougtrajano ,

The idea of the custom calculations here are that they evaluate to a single value for the entire table. In the expression here, you are trying to divide a column (acessos) by a single value (sum of acessos). The error is happening because this wouldn't return a single value for the table, it would evaluate to a single value for each row.

Based on your description, I think what you want here is either:

1. Another column that is the value in acessos / sum(acessos), which should be defined in the query.

2. A single value, in which case you'd need some sort of agregation on the numerator (currently the whole column 'acessos') to have it evaluate to a single value, so that the expression as a whole can return a single value.

If you have a clear description of what you are trying to calculate, I can help you modify the expression.