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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
juliakhaa
Creator
Creator

Extracting word from text

Hi all!
Dear users of this community, please help me with one question.
I have a field from which I need to extract a word that starts with ZNO followed by some set of numbers (string type), for example, ZNO123573.
That is, let's say the field has the following text: "Closing the account ZNO127463 will be executed on 20.04.23" at the output I want to get "ZNO127463".

 

The word can be anywhere in the text, even on the next line

12 Replies
juliakhaa
Creator
Creator
Author

Haha, it’s okay, thanks 

N30fyte
Creator
Creator

For the sake of completeness...

 

= if (index (text_field,'ZNO') = 0 //'ZNO' does not occur in the text field
, // then
'-' // a dash
, // otherwise
'ZNO' & TextBetween (text_field & ' ','ZNO',' ')
)

 

This appends space to the end of the text field. A bit of a cludge, but it seems to work.

juliakhaa
Creator
Creator
Author

Fan < Big Fan