SELECT list expression [field] which is neither grouped nor aggregated at

Knowledge Drop

Last tested: May 26, 2020
 

This error can occur when you have a measure that is not doing any aggregation, most commonly- a measure of type number that is referencing a dimension. For example:
 

dimension: id {

type:number

sql: ${TABLE}.id

}

measure: not_working {

type: number

sql: ${id}

See also SQL Error: "X is not a valid group by expression"

This content is subject to limited support.                

Comments
olof_evenvik
Explorer

I ran into the same thing. Is the behavior you describe expected, or a bug?

What is the recommended way to get around this problem?

Dawid
Participant V

@olof_evenvik  you need to change measure type to sum/count/average

Version history
Last update:
‎07-07-2021 01:12 PM
Updated by: