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
Ammonite | Level 13

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
Ammonite | Level 13

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-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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