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: 
Not applicable

How do I use keep the middle string and nothing else?

I have a strong of information that looks like:

ON-1055661-1

I want the middle string in order to connect to another database that uses only that part of the data, but I can't figure out how to remove it consistently, since the first and last string can vary greatly. (Not by the number of characters in each, but with what the characters are).

I tried using subfield '-' so that it looked at each string independently, but there is so much clutter now.

1 Solution

Accepted Solutions
Colin-Albert

Subfield(yourfieldname, '-', 2) will extract the string within the dashes.

View solution in original post

4 Replies
Colin-Albert

Subfield(yourfieldname, '-', 2) will extract the string within the dashes.

sunny_talwar

So all the records within this field will have a similar structure? xxxx-xxxx-xxxx (with xx can vary in number?) If this is the case then Subfield should work for you. If not, then is there any kind of symmetry among the records?

Best,

S

jagan
Luminary Alumni
Luminary Alumni

Hi,

If all the values are in the same format then you can use

SubField(FieldName, '-', 2)

OR You can also try

TextBetween(FieldName, '-', '-')

Regards,

Jagan.

Not applicable
Author

Thanks everyone who answered, the first answer did the trick!