Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reference a field name which includes a slash in Power Query

Tags:

powerquery

In Excel 2016 Get & Transform ("Power Query") it appears to be totally valid to have a field (column) name containing a slash character. However, when I try to reference this column, I can't find any way to escape the slash to make the reference work. How can I do this?

Specifically, the following code is accepted:

Table.AddColumn(#"Capitalize", "ABC Table", each Table.FromColumns({Text.Split([ABC], ",")}))

...but the following is not:

Table.AddColumn(#"Capitalize", "ABC Table", each Table.FromColumns({Text.Split([ABC / DEF], ",")}))

...presumably because of the slash in [ABC / DEF].

How can I escape this slash?

like image 369
Matt Wenham Avatar asked Jul 12 '17 14:07

Matt Wenham


People also ask

How do you reference a query in Power Query?

It turns out, the way to query a query is to create a Blank Query and then reference your query as a source. Press the Get Data button found in the Get & Transform Data section of the Data tab. Select From Other Sources in the menu. Select Blank Query in the menu.

What does #( LF mean in Power Query?

In this case, the escape sequence #(lf) is telling power query to insert a linefeed. This is one of three control escape codes supported by Power Query, the others are: #(cr) carriage return. #(tab) tab.


1 Answers

Try using [#"ABC / DEF"] instead of [ABC / DEF].

like image 81
Marc Pincince Avatar answered Dec 12 '22 13:12

Marc Pincince