BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PatrykSAS
Obsidian | Level 7

Hello,

I'd like to cut off a specific part from string. I'm looking for solution made in query builder with enterprise guide. I want to delete all parts containing 'PL003' or 'PL005'.

Example string:

PL0031234

PL00512345

PL003PL005123456

 

My target to achieve:

1234

12345

123456

Can you help me?

1 ACCEPTED SOLUTION

Accepted Solutions
AhmedAl_Attar
Rhodochrosite | Level 12

In the Query builder, create new calculated column, as 'Advanced Expression', and in the expression use the following

/* new */
(PRXCHANGE('s/PL00\d//',-1,t1.x)) AS new

This will give you the desired output.

 

Hope this helps,

Ahmed

 

View solution in original post

2 REPLIES 2
AhmedAl_Attar
Rhodochrosite | Level 12

In the Query builder, create new calculated column, as 'Advanced Expression', and in the expression use the following

/* new */
(PRXCHANGE('s/PL00\d//',-1,t1.x)) AS new

This will give you the desired output.

 

Hope this helps,

Ahmed

 

PatrykSAS
Obsidian | Level 7

Thanks a lot! This expression works great.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 777 views
  • 0 likes
  • 2 in conversation