invalidQuery: SELECT list expression references tb_ind_performance_360.mes which is neither grouped nor aggregated at [2125:17]" when running the following measure in LookML:
measure: insta_prazo_mes_segui{
type: number
sql: case
when (${valor_ms_date} >= DATE(“2022-02-01”)) AND
(${valor_ms_date} <= current_date()) then ${gross}
END;;
}
When you create a measure in LookML, there are two main categories of measure types:
those that apply the SQL aggregate function for you - e.g. sum, count, average
those that are more flexible but require you to ensure you apply the aggregates yourself - e.g number, string
In this case, it looks like you’re trying to do some sort of calculation. You should ensure that you either apply SQL aggregate functions in your measure’s SQL, or reference fields that are themselves measures which already have aggregates applied