Table.Group with GroupKind.Local and Comparer => Expression.Error

Lz._ 8,991 Reputation points
2020-11-22T16:59:58.103+00:00

Hi

Searched previous Technet forum but didn't find something and not sure I understand:

let  
    Source = Table.FromRecords(  
        {[ID="A",Value=1],[ID="a",Value=1],[ID="b",Value=2],[ID="B",Value=2]},  
        type table [ID=text,Value=number]  
    ),  
    Group1 = Table.Group(Source, {"ID"},  
        {"Sum", each List.Sum([Value]), type number},null,Comparer.OrdinalIgnoreCase  
    ), // OK  
    Group2 = Table.Group(Source, {"ID"},  
        {"Sum", each List.Sum([Value]), type number},GroupKind.Global,Comparer.OrdinalIgnoreCase  
    ), // OK  
    Group3 = Table.Group(Source, {"ID"},  
        {"Sum", each List.Sum([Value]), type number},GroupKind.Local,Comparer.OrdinalIgnoreCase  
    ) // Expression.Error: We cannot apply operator < to types Record and Record  
in  
    Group3  

41670-error.png

EDIT: Same error with GroupKind.Local, Comparer.FromCulture("en-US",true)
and GroupKind.Local, Comparer.Ordinal (not what I expect to achieve)

EDIT2: Changing the key (2nd argument) type from list to text does it
41660-text-vs-list.png

(Excel 365 64Bit v2010 Build 13328.20408 Click to run)
Thanks

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,882 questions
{count} votes

Accepted answer
  1. Ehren (MSFT) 1,781 Reputation points Microsoft Employee
    2020-12-07T22:35:09.77+00:00

    Hi Lz. This appears to be a bug. We'll investigate a fix.


1 additional answer

Sort by: Most helpful
  1. Lz._ 8,991 Reputation points
    2021-03-12T08:48:57.23+00:00

    Appears to be fixed in XL 365 version 2102 build 13801.20266 - PQ v2.90.582.0

    let  
        Source = Table.FromRecords(  
             {[ID="A",Value=1],[ID="a",Value=1],[ID="b",Value=2],[ID="B",Value=2]},  
             type table [ID=text,Value=number]  
        ),  
        Grouped = Table.Group(Source, {"ID"},  
            {"Sum", each List.Sum([Value]), type number},  
            GroupKind.Local, Comparer.OrdinalIgnoreCase  
        )  
     in  
        Grouped  
    

    ==> 77133-demo.png

    Thanks @Ehren (MSFT) & Excel team

    0 comments No comments