Forum Discussion
Auto-rename all Query columns e.g. to remove underscore
Meanwhile the author of "Table.TransformColumnNames" (hint: me) is crying somewhere :'( I think it came out in July '15 update.
Nice code anyway :)
- greggyb10 years agoResident Rockstar
I've gotta be honest, Power Query is not too discoverable on its own, arify. This is not a criticism of you, but the UI guys. The latest iteration of the DAX editor in PBI is pretty decent. The Power Query editor is pretty dismal. There's no intellisense or anything similar to help identify which functions are available. It's clunky to cross back and forth from PQ to the formula reference online and back.
- arify10 years agoMicrosoft Employee
You're right, I wish it had something like Intellisense too, but I'm not sure if it'll happen anytime soon. Instead, normally I'd recommend people to discover functions at 2 places
- PQ Formula Language page https://msdn.microsoft.com/library/Mt253322?ui=en-US&rs=en-US&ad=US , but I noticed that Table.TransformColumnNames isn't there yet. We'll put it soon. Sorry about that
- Typing
= #shared
in the Query Editor formula bar (this will always be up to date.)
- greggyb10 years agoResident Rockstar
arify, may I ask why you don't see any sort of intellisense coming soon? This is well out of my wheelhouse, but it seems like with the strong similarities to F#, a lot of the work will have already been done by th VS team.
Is it just low priority or am I missing something?
- LarsSchreiber10 years agoResponsive ResidentHi greggyb,
as you say the Power Query Editor is not really helpfull. This why I created my own Editor, including IntelliSense and synthax highlighting using Notepad++. Follow this link. Maybe this is helpfull for you:
http://power-bi-usergroup.blogspot.de/2015/11/creating-editor-for-power-query-with.html?m=0
Regards,
Lars
- mike_honey10 years agoMemorable Member
arify - I hadn't heard of that one and nothing like that came up after a lot of searching. Now you have named a specific function that sounds great but ... I just tried searching for "Table.TransformColumnNames" and I didnt get any relevant results (besides your mention on this thread). I can't see it listed in the MSDN PQ function doco either. Do you have any info you can share on it?
My 2c would be that developing code changes without any published mention or doco (including several practical examples) is basically pointless ...
- arify10 years agoMicrosoft Employee
Hi mike_honey,
We're still working on updating our documentation. Next time you needed a library function that doesn't appear in the documentation, try typing
= #shared
to the Power Query's formula bar like I suggested to greggyb. But 99% of the time, the function is already mentioned in a nicer way in the documentation, so that should be the first try.
About how to use it, there's some explanation and an example when you type
= Table.TransformColumnNames
to the PQ formula bar. In your case, it should probably look like this:
= Table.TransformColumnNames(table, (columnName as text) as text => Text.Replace(columnName, "_", ""))
- arify10 years agoMicrosoft Employee
It is up now, thanks everyone https://msdn.microsoft.com/en-us/library/mt674878.aspx
- edwardrmiles9 years agoHelper III
I'm struggling to understand from the documentation how Table.TransformColumnNames works. Any chance you could provide a simple example, e.g. prefixing every column of a table called DimDate with the string "Order "?