Forum Discussion

abergs's avatar
abergs
Copper Contributor
Feb 20, 2019
Solved

How can I summarize by case insensitive?

Currently I'm doing 'summarize by tolower(name)' but I suspect that to be suboptimal
  • Yoni's avatar
    Feb 20, 2019

    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)

     

Resources