Forum

power query etract ...
 
Notifications
Clear all

power query etract values begining with a number.

4 Posts
2 Users
0 Reactions
122 Views
(@sana)
Posts: 2
New Member
Topic starter
 

Hi,

I am trying to extract values in a coulum which has values start with a number. This column has values starting with a number and starting with a alphabatic letter both without any pattern. Therefore, I can't use modulo.

I have been using a query to extract the vlaues strating with specific number and it works (for example ( if Text.StartsWith([Our Ref_1],"5") then [Our Ref_1] else null)))

But now my range is 0-9, it could be any number I want to extract whole value starting with number and I am struggling with the range.

For example, as in the picture I want to keep/extract whole value starting with '10100, computer equipment - brought forward'

 

Sana

 
Posted : 06/11/2021 5:39 pm
Alan Sidman
(@alansidman)
Posts: 222
Member Moderator
 

if Text.StartsWith([Our Ref_1],{0..9}) then [Our Ref_1] else null)))

try this

 
Posted : 07/11/2021 12:22 am
(@sana)
Posts: 2
New Member
Topic starter
 

Hi Alan,

Thank you.

I have tried it but for some reason it is giving an error.

 
Posted : 07/11/2021 5:12 pm
Alan Sidman
(@alansidman)
Posts: 222
Member Moderator
 

How about loading a sample workbook showing what you have and then mock up what you expect the results to look like.  We can then analyze and provide a suitable response.  Without seeing your data, it is difficult to test a suggested solution.

 
Posted : 07/11/2021 11:09 pm
Share: