Hi Lz. This appears to be a bug. We'll investigate a fix.
Table.Group with GroupKind.Local and Comparer => Expression.Error
Lz._
8,991
Reputation points
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
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
(Excel 365 64Bit v2010 Build 13328.20408 Click to run)
Thanks
Accepted answer
-
Ehren (MSFT) 1,781 Reputation points Microsoft Employee
2020-12-07T22:35:09.77+00:00
1 additional answer
Sort by: Most helpful
-
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
==>
Thanks @Ehren (MSFT) & Excel team