[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-31 (世界標準時間)。"],[],[],null,["# Error: Column < name > must appear in the GROUP BY clause or be used in an aggregate function\n\nThis page can help you troubleshoot the `column ``name`` must appear in the GROUP BY clause or be used in an aggregate function` error in Looker.\n\n\nThis error commonly occurs when a dimension is used in a measure that does not have an aggregate type. Our [measure type documentation](/looker/docs/reference/param-measure-types#measure_type_categories) contains a list of measure types and whether each is an aggregate type.\n\n\nFor example, a `type: number` measure is not an aggregate measure, so this LookML would produce an error: \n\n```\nmeasure: bad_measure {\n type: number\n sql: ${measure} + ${dimension} ;;\n}\n```\n\n\nTypically you fix this problem by first turning the dimension into a measure, and then using that new measure in your calculations. For example: \n\n```\nmeasure: dimension_total {\n type: sum\n sql: ${dimension} ;;\n}\n\nmeasure: good_measure {\n type: number\n sql: ${measure} + ${dimension_total} ;;\n}\n```"]]