Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
mkudis
Contributor II
Contributor II

Text inside a string

I have a field (log_message) that is a large string of data that I would like to pull a particular piece of text from, but the string is not always the same values in the same position.  Is this possible?  An example of the string is:

Status update applied:  Branch ID:  Texas Tran: 123456-1 Type: XX Orig Status: S New Status: D User jdoe Date/Time Tue Apr 6

then the next row of data may be something like

Related image applied: Branch ID: Texas Tran: 123456-1 User: jdoe Date/Time: Tue Apr 6

So I basically will always need to pull the first 6 digits of information after 'Tran: ' 

Labels (1)
1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

=SubField (SubField(log_message,'Tran:',2),'-1',1)

Untitled.png

View solution in original post

4 Replies
jwjackso
Specialist III
Specialist III

=SubField (SubField(log_message,'Tran:',2),'-1',1)

Untitled.png

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Or

TextBetween(log_message, 'Tran:', '-')

-Rob

mkudis
Contributor II
Contributor II
Author

Doesn't seem to be working with either expression.  Wondering if it has to do with the string itself, as I would expect this to return it pretty easily.

 

The issue may be the type of sheet object I am using.  What type of sheet object would I use to show this data correctly?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Either expression should work in a table object where the Dimension is log_message.

-Rob