SOLVED

# How can I summarize by case insensitive?

Copper Contributor

# How can I summarize by case insensitive?

Currently I'm doing 'summarize by tolower(name)' but I suspect that to be suboptimal
2 Replies
best response confirmed by abergs (Copper Contributor)
Solution

# Re: How can I summarize by case insensitive?

Depending on the kind of aggregation you're doing, it may be useful to first summarize by name and then summarize again by tolower(name), so that your query converts significantly fewer strings to lowercase.

Doing so is possible, for example, in the following case, with a count() aggregation:

```datatable(s:string)
[
"abc",
"def",
"ABC",
"AbC",
"def",
"ABc"
]
| summarize c = count() by s
| summarize c = sum(c) by s = tolower(s)```

# Re: How can I summarize by case insensitive?

I found another problem with case insensitive, it doesn't seem to work on letter such as "Å Ä Ö".

E.g

print "ÖVRIGT" =~ "övrigt" // false

print "VRIGT" =~ "vrigt" // true

Is it possible to instruct Data Explorer to use Invariantculure etc?

1 best response

Accepted Solutions
best response confirmed by abergs (Copper Contributor)
Solution

# Re: How can I summarize by case insensitive?

Depending on the kind of aggregation you're doing, it may be useful to first summarize by name and then summarize again by tolower(name), so that your query converts significantly fewer strings to lowercase.

Doing so is possible, for example, in the following case, with a count() aggregation:

```datatable(s:string)
[
"abc",
"def",
"ABC",
"AbC",
"def",
"ABc"
]
| summarize c = count() by s
| summarize c = sum(c) by s = tolower(s)```