Knowledge Drop

How to group without case sensitivity

Userlevel 5
  • Looker Staff
  • 173 replies

Last tested: Jun 24, 2019


The Problem

My result set is returning duplicates that only differ in uppercase and lowercase. For example, 'shorts' and 'Shorts' are being treated as two different rows.

case sensitive.png

A Solution

These results are literally different records in the database. So if you want to coerce them to be the same, you'll need to edit the SQL of the field. One example is to convert the field to lowercase using the LOWER function:

dimension: item_name {

type: string

sql: LOWER(${TABLE}.item_name) ;;



The actual function may differ depending on your database. You may instead try to use UPPER or an equivalent if that's how you want to view the results.



This content is subject to limited support.                



0 replies

Be the first to reply!