Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Eduard23
Contributor III
Contributor III

Expression for Word + Number will be change

Hi ALL,

having problem for the if a word contains  VD it will be "RCI" and the rest will be IMSPI

LOCATION Expected Result
VDD-1-1-2 RCI
VDD-1-3-2 RCI
LP121321312 IMSPI

 

i use this one for excel but in qliksens don't know the right expression

IF(ISNUMBER(SEARCH("VD",E1)),"RCI","IMSPI")

Labels (1)
1 Solution

Accepted Solutions
justISO
Specialist
Specialist

Hi, try

if(index([LOCATION], 'VD')>0, 'RCI', 'IMSPI')

View solution in original post

4 Replies
justISO
Specialist
Specialist

Hi, try

if(index([LOCATION], 'VD')>0, 'RCI', 'IMSPI')

Eduard23
Contributor III
Contributor III
Author

its working now. thanks JustISO,

i also try adding in expression and it work also. because there is chance that location name they will add new.

if(index([LOCATION], 'VD')>0, 'RCI', if(index([LOCATION], 'CT')>0, 'RCI','IMSPI'))

justISO
Specialist
Specialist

in bigger scope of conditions, you can use other approach and use wildmatch() function, which allows to define in witch place of string to look needed symbols. In your case:

if( wildmatch([LOCATION], 'VD*', 'CT*')>0, 'RCI', 'IMSPI')

notice, that 'VD*' means that we are taking into account only cases when string starts with VD. '*VD*' would mean that we are looking 'VD' anywhere in the string.

https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ConditionalF...

 

Eduard23
Contributor III
Contributor III
Author

Very Nice, i try it and its working.