Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III
Creator III

Creating a variable by searching a text field

Hi - I am not sure if the following can be done or not.

I am looking to do the following to create a variable (example Field1) automatically populated with the following:

* Search through another text variable (example Field2) and find the string ABC #: within the text

* Once it finds ABC #:  string it captures the ten characters after the ABC #: string and populates Field1 with that string of ten characters:

Example: Field2 contains a bunch of characters.  

"Hello world text text text ABC #:1234567890 more text more text more text'

Field one would contain '1234567890' (even 'ABC #:1234567890' is fine).

 

Thoughts ? Jerry

2 Solutions

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

maybe try with this expression for variable Field2

=TextBetween($(Field1),'ABC #:',' ')

View solution in original post

jerryr125
Creator III
Creator III
Author

Ok got it !

 

=TextBetween(fieldname,'at','Te')

 

Thank you for the lead ! Jerry

View solution in original post

3 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

maybe try with this expression for variable Field2

=TextBetween($(Field1),'ABC #:',' ')

jerryr125
Creator III
Creator III
Author

Hi - thank you for your help.

I did a test with a simple string of text:

=TextBetween('MaterialTest','at','Te')


Works great !

The question now is how do I get to work with  a field ? 

Thoughts ? Jerry

jerryr125
Creator III
Creator III
Author

Ok got it !

 

=TextBetween(fieldname,'at','Te')

 

Thank you for the lead ! Jerry