OpenBI Docs Buy

Table.FuzzyGroup

Groups rows whose key texts are spelled alike, not only the same, and works out a column per group.

Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Table.FuzzyGroup(table as table, key as any, aggregatedColumns as list, optional options as nullable record) as table
ParameterTypeDescription
tabletableThe rows to group.
keyanyThe key column, or a list of key columns; they must hold texts.
aggregatedColumnslistOne or more {name, function, type}, as in Table.Group: a function of the group's rows as a table.
optionsnullable record
optional
IgnoreCase (true unless false), IgnoreSpace (true unless false), Threshold (0.80 unless you give another, from 0 to 1) and TransformationTable (a table with From and To columns: texts to read as the same).

Returns

table. One row per group: the key as the group's most frequent spelling, then the new columns.

Remarks

  • The key columns must be of type text.
  • Each group is shown by its most frequent spelling; with a tie, by the one that comes first.
  • How two texts are compared, and the few pairs near a threshold that come out otherwise, are in the M functions page's Fuzzy matching section.

Examples

Units per shop, spellings merged

let
    Sales = #table(type table [Shop = text, Units = number], {
        {"Oslo Sentrum", 4}, {"oslo sentrum", 2}, {"Oslo Sentrm", 1}, {"Oslo Sentrum", 1},
        {"Bergen Torget", 3}, {"BERGEN TORGET", 5}})
in
    Table.FuzzyGroup(Sales, {"Shop"}, {
        {"Units", each List.Sum([Units]), type number},
        {"Rows", each Table.RowCount(_), Int64.Type}})
ShopUnitsRows
Oslo Sentrum84
Bergen Torget82

Table.Group, Table.AddFuzzyClusterColumn, Table.FuzzyJoin.

Last updated · OpenBI Studio 0.3.79