How to group without case sensitivity

Knowledge Drop

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.

insensitive.png

This content is subject to limited support.                

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