Select 行基于变量列名称
Select rows based on variable column name
这个好像不难,但是我就堆到这里了。
我想通过变量名引用 table 列进行过滤,但不明白为什么这不起作用。
let
Source = Table.FromRecords({
[VarColumn = "Val", Phone = "123-4567"],
[VarColumn = "Val2", Phone = "987-6543"],
[VarColumn = "NA", Phone = "543-7890"],
[VarColumn = "OTHER", Phone = "543-7890"]
}),
VariableColumn = "VarColumn",
filter = Table.SelectRows(Source, each (Table.Column(Source, VariableColumn) = "OTHER"))
in
filter
尝试
filter = Table.SelectRows(Source, each Record.Field(_, VariableColumn) = "OTHER")
这个好像不难,但是我就堆到这里了。 我想通过变量名引用 table 列进行过滤,但不明白为什么这不起作用。
let
Source = Table.FromRecords({
[VarColumn = "Val", Phone = "123-4567"],
[VarColumn = "Val2", Phone = "987-6543"],
[VarColumn = "NA", Phone = "543-7890"],
[VarColumn = "OTHER", Phone = "543-7890"]
}),
VariableColumn = "VarColumn",
filter = Table.SelectRows(Source, each (Table.Column(Source, VariableColumn) = "OTHER"))
in
filter
尝试
filter = Table.SelectRows(Source, each Record.Field(_, VariableColumn) = "OTHER")