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

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

How to use a mid function

Does anyone know how to use a mid function where you grab a word between a delimiter? I have a field that has a name of a location in between a description...

For example (i.e Yellow-California-Medium or Yellow-Utah-Small) but I can't use the location of the character because the location can have different characters (California vs. Utah) so I would need whatever is between the delimiter..

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

Try this:

=TextBetween(FIELDNAME, '-', '-')

or you can use subfield:

=subfield(FIELDNAME, '-', 2)

Hope this helps!

View solution in original post

3 Replies
its_anandrjs
Champion III
Champion III

You can use subfield function for this for your example

Ex:-

LOAD Desc, SubField(Desc,'-',2) as City;

LOAD * Inline

[

Desc

Yellow-California-Medium

Yellow-Utah-Small

];

And you get California and Utah if i understand clearly

jerem1234
Specialist II
Specialist II

Try this:

=TextBetween(FIELDNAME, '-', '-')

or you can use subfield:

=subfield(FIELDNAME, '-', 2)

Hope this helps!

Not applicable
Author

Jeremiah, that works perfectly. Thanks for your assistance!