Forum

Cleaning up a colum...
 
Notifications
Clear all

Cleaning up a column in power query

3 Posts
2 Users
0 Reactions
68 Views
(@robm)
Posts: 9
Active Member
Topic starter
 

These courses have been unbelievably helpful, but I have run into 2 issues in PQ that I can't seem to solve - will just deal with the one problem for now.

Raw data is collected from our fleet management software using the CSV string. The crew is required to complete a daily log which gives a lots of different information. One of the boxes of the form is a drop down multi select box, where the crew list who is on board that day, by clicking on each name.

When I export this data into PQ, I have a column with 1, 2,3 or 4 names in it depending on how many crew on were on board that day.

In my pivot table I want to see a breakdown of each crewmans activity (working / standby / etc) for each month

In PQ I have tried splitting the column into 4 columns separated by the delimiter (,) - This is fine but since the names are NOT always entered in the same order you can end up with 4 columns. As you can see below if you filter column 1 for "Bill" you'll not see the other 2 days bill was working as he was listed in C2 & C3

 

Crew col 1

Crew Col 2

Crew col 3

Crew Col 4

15/6/19

Bill

Fred

John

Sam

16/6/19

Fred

John

Bill

 

17/6/19

Sam

Bill

 

 

I have tried splitting this column into Rows. This is much more successful except, because the column has spilt at the delimiter, the 2nd entry has a space in-front of the name. Thus, when I come to create a pivot table or a slider, instead of 4 crew names I get perhaps 8 because I have

Bill

Fred

John

Sam

  Bill

  John

  Fred

  Sam  

I can make it work like this using a slider and selecting both "John's" to get his activity breakdown

However it would be much simpler if I could clean or correct align this text in this column

Any help or pointers greatly appreciated

Thanks

Rob

 
Posted : 18/04/2020 4:57 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Rob,

You can remove the leading/trailing spaces via the Transform tab > Format > Trim button.

Mynda

 
Posted : 18/04/2020 6:35 am
(@robm)
Posts: 9
Active Member
Topic starter
 

Awesome... that works perfectly . Thanks

 
Posted : 18/04/2020 7:09 am
Share: