Incorrect handling or variable name in Power Query

Andrey Minakov 1 Reputation point
2023-11-20T14:55:03.6933333+00:00

= let l = {"Тип Операции", "Наименование", "ПризнакУУ", "ВидОперации", "НоменклатурнаяГруппа", "ИД"}, t = #"Добавлен пользовательский объект1" in Table.Group(t, l, {{"Кол-во компаний", each Table.RowCount(_)}} &

List.Transform(List.Difference(Table.ColumnNames(t), l), each {_, (x)=> Text.Combine(List.Select(List.Distinct(Table.Column(x, )), each Text.Clean(Text.Trim()) <> ""), "; "), type text}))

It seems that in "each Text.Clean(Text.Trim())" PQ uses variable from "each {, (x)=>" function, and not from the function "each Text.Clean(Text.Trim(_))" itself. At least in this variant List.Select() doesn't filter empty strings, and in this variant it does (the only difference is "(y)=> Text.Clean(Text.Trim(y))"):

List.Transform(List.Difference(Table.ColumnNames(t), l), each {_, (x)=> Text.Combine(List.Select(List.Distinct(Table.Column(x, _)), (y)=> Text.Clean(Text.Trim(y)) <> ""), "; "), type text}))

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,683 questions
0 comments No comments
{count} votes