Forum

Text.Select only vo...
 
Notifications
Clear all

Text.Select only vowels from a field.

5 Posts
2 Users
0 Reactions
185 Views
Alan Sidman
(@alansidman)
Posts: 222
Member Moderator
Topic starter
 

I am attempting to remove all consonants from a column of Text only data.

 

ie.  Alan will result in Aa

Maxwell will result in ae

Combine will result in oie

 

I have attempted using Text.Select([FieldName],{"A","E", "I", "O", "U","a","e","i","o","u"}) with out success.  PQ generates an error and indicates the error at the first comma.

 

Any thoughts on a workaround

 

Alan

 
Posted : 28/06/2021 10:33 am
(@catalinb)
Posts: 1937
Member Admin
 

Try this one:
let
Custom2 = List.Select(Text.ToList("Combine"),each List.Contains({"A","E", "I", "O", "U","a","e","i","o","u"},_))
in
Custom2

 
Posted : 28/06/2021 11:32 am
Alan Sidman
(@alansidman)
Posts: 222
Member Moderator
Topic starter
 

Thought we might be onto something there.  However, that returns a List and when expanded shows only the letters oie for each record.  The data being tested is seven rows of data, each row the name of the day of the week, ie.  Sunday, Monday, etc.

 

Really didn't think that this would be so difficult.

 
Posted : 28/06/2021 8:23 pm
(@catalinb)
Posts: 1937
Member Admin
 

It's not that difficult, I gave you the formula, was hoping you can adapt it to your scenario.

Returns the oie list because I used Text.ToList("Combine"), where the part in red is the analized text. Combining a list back into text is very easy: Text.Combine.

Full example attached.

 
Posted : 28/06/2021 11:14 pm
Alan Sidman
(@alansidman)
Posts: 222
Member Moderator
Topic starter
 

My apologies.  I missed changing your lookup word to my field name when I copied and pasted for testing.  Thank you for your help and pointing out my carelessness.  Much appreciated.  Your scenario works perfectly when applied properly.

 

Alan

 
Posted : 29/06/2021 12:31 pm
Share: