BookmarkSubscribeRSS Feed
xiaoyao026
Calcite | Level 5

hello everyone

 

i'm trying to use advance expression to achieve below 2 function, to get a value as 1 or 0, however, difficult to find a proper function to acheive this.

 

1st function:

 

A: MOTOR

 

B: WIPER MOTOR,RHD

 

how can i judge if string of A include in B, if yes, then return 1, else 0

 

2nd function:

 

A: 34

 

B: 34;53;54

 

how can i judge if value A can be found in B,  if yes, then return 1, else 0

 

 

thank you for advice in advance.

 

BR

 

 

2 REPLIES 2
Reeza
Super User

INDEXW and FINDW will work in both your cases.

ballardw
Super User

Your exampled may require more details for instance is

A: MOTOR considered found

 when

B: MOTORBOAT,RHD  (part of word)

or

B: WIPER motor,RHD  (case sensitive search)

 

or is

A: 34 considered found

when  

B: 345;53;54

 

IN

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 648 views
  • 0 likes
  • 3 in conversation