question

Lz-3068 avatar image
0 Votes"
Lz-3068 asked ·

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

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


power-query-m
error.png (3.9 KiB)
text-vs-list.png (3.5 KiB)
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Lz-3068 ,
We are mainly responsible for general issues of Office desktop applications, but your question seems to be more related to the code of Power Query. I would remove the tag "office-excel-itpo".
Thanks for your understanding.

0 Votes 0 ·
Ehren avatar image
0 Votes"
Ehren answered ·

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

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Ehren

That's what I suspected. Not a surprised (same dll I suspect), same issue with PBI Desktop v2.87.1061.0

Thanks again

0 Votes 0 ·
Lz-3068 avatar image
0 Votes"
Lz-3068 answered ·

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 & Excel team


demo.png (5.3 KiB)
·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.