Forum

How to extract data...
 
Notifications
Clear all

How to extract data from a column with variable length string of characters

3 Posts
2 Users
0 Reactions
93 Views
(@ktaylor)
Posts: 2
New Member
Topic starter
 

Hi, I've got a report which returns number of seats booked in each class as one column, delimited by a comma space, e.g.

E-2, G-17, N-1, Q-1, V-1, X-1. This varies by what classes were booked on that particular flight, i.e. they're always ordered alphabetically, but not all are present as per attached example.

Currently I have to use Data to Columns (split by delimiter), then sort each resulting column by the letter code, move to appropriate column and then replace all E-   G-  N-  etc. by nothing, to get the number of booked seats for each class.

 

I am very new to Power Query and am trying to figure out if/how I can get it to do this for me. I have tried to write some IF formulas in the advanced editor, but without luck so far.

 

ETA: I'm using MS Office 365

 
Posted : 30/10/2020 9:44 pm
(@ktaylor)
Posts: 2
New Member
Topic starter
 

I think I have figured it out, using Add Column from Examples, and then tweaking the script to change the delimiter to each class (e.g. E-, G- etc.)

 
Posted : 30/10/2020 11:13 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Katerina,

If you get stuck just let us know.

Regards

Phil

 
Posted : 30/10/2020 11:20 pm
Share: