Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Drop all characters after string is detected in field

Hi,

After a lot of trial, error and searching the forums i cannot seem to come with a conclusion to my issue. If anyone can help that would be greatly appreciated.

I'm trying to drop all characters (numeric or non-numeric) after a word in a field is detected:

I want to be able to drop EVERYTHING after "router" is found in the field resource and keep everything before it

eg.

field name:

  • resource

field values:

  • CA-E-router123.cisco
  • AP-V-router2.cisco
  • ME-UL-router72.cisco

desired result:

  • CA-E-router
  • AP-V-router
  • ME-UL-router

Thanks in advance!

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

subfield([resource],'router',1) & 'router'


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

subfield([resource],'router',1) & 'router'


talk is cheap, supply exceeds demand
Clever_Anjos
Employee
Employee

Testing if 'router' is present

=if(Index(resource,'router')>0,Left(resource,Index(resource,'router')-1)&'router',resource)

Not applicable
Author

Thank you Gysbert! That was a quick, easy solution.