From the course: Advanced Power Query
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Replicate Excel's TRIM function
From the course: Advanced Power Query
Replicate Excel's TRIM function
- You might have worked with the trim function in Excel. It's beautiful because what it does it, it allows you to take off the extra spaces or useless spaces at the start of any string, from the middle of any string, and from the end of any particular string. But, however, Power Query's trim function doesn't quite work like that. It just works for the starting spaces and the ending spaces, but does not do anything to the spaces in between off the stream. If we want to replicate the behavior of the Excel's trim function in Power Query, we have to do beyond the work of the user interface. Let's just take a look at how can we replicate Excel's trim function into Power Query. Alright, take a look at this Excel file that I'm working with. You can clearly see that we have a couple of starting spaces, a couple of trailing spaces, and a few extra spaces in between. And sure enough, you already know the formula in Excel, which is nothing but the trim function. And once I use that, the trim…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.