我在一家电力BI查询工作,试图从文本修剪空白。Text.Trim语法含义
纵观微软的M个参考,我碰到了Text.Trim
语法传来:
Text.Trim(text as nullable text, optional trimChars as any) as nullable text
我无法弄清楚如何将它正确地插到我的查询码(在那里将实际工作),所以我做了一些更多的搜索和跨此次前来:
#"Trimmed Text" = Table.TransformColumns(#"Removed Other Columns",{},Text.Trim),
...这看起来并不像任何微软的语法,但对我来说工作得很好,因为我将它插入我的代码是这样的:
let
Source = Banding,
#"Removed Other Columns" = Table.SelectColumns(Source,{"Segment", "Granular Band"}),
#"Trimmed Text" = Table.TransformColumns(#"Removed Other Columns",{},Text.Trim),
#"Removed Duplicates" = Table.Distinct(#"Trimmed Text", {"Granular Band"})
in
#"Removed Duplicates"
我的问题是,我不明白是什么行的语法意义是。我基本上把微软的例子理解为意思,修剪这个;这是我想要修剪的文字。非常简单。
但我不知道是什么,实际工作行的语法意义。我知道它说要转换表格列(Table.TransformColumns
);但我不知道,如果参考前面的线(#"Removed Other Columns"
)作为任何真正的“输入”为Text.Trim
或者{}
是在表中的所有列的引用,或(更重要的是我)我怎么会引用特定列。 (我试过指定列的几种方法,并每次都失败。)我也想不明白,为什么我不需要以下Text.Trim
(如微软的例子)的任何参数。
如果有人能翻译一下线的方式,我可以理解“的说法”,我确实很感激。