Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

substring in qlikview?

Hello,

Is there a way to catch string in value of a field, like substr in SQL?

I would like to catch et text between "from" and "to" of values from "type" field

Example :

Status Changes From Affected to resolved

i would like only Affected, between from and To

Load

  type as TYPE

From

[\\s-vm-qvw-01\SM7\activity_GCE_RS.qvd]

(qvd) ;

Any idea for helping me?

stephane

1 Solution

Accepted Solutions
nagaiank
Specialist III
Specialist III

The string function 'mid' has features similar to SQL substring function. An extract from the Qlikview Reference manual is below:

mid( s , n1 [ , n2 ] )

Substring of the string s. The result is the string starting at character n1 with the length of n2 characters. If n2 is omitted, the function returns the rightmost part of the string starting at character n1. The positions in the string are numbered from 1 and up.

Examples:

mid('abcdef',3 ) returns 'cdef'.

mid('abcdef',3, 2 ) returns 'cd'.

mid( Date,3 ) where Date = 970714 returns 0714

mid( Date,3,2 ) where Date = 970714 returns 07

For a more complicated example, see the index function.

View solution in original post

4 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

TextBetween(type,'From ',' to ')     AS     TYPE

Hope this helps,

Jason

nagaiank
Specialist III
Specialist III

The string function 'mid' has features similar to SQL substring function. An extract from the Qlikview Reference manual is below:

mid( s , n1 [ , n2 ] )

Substring of the string s. The result is the string starting at character n1 with the length of n2 characters. If n2 is omitted, the function returns the rightmost part of the string starting at character n1. The positions in the string are numbered from 1 and up.

Examples:

mid('abcdef',3 ) returns 'cdef'.

mid('abcdef',3, 2 ) returns 'cd'.

mid( Date,3 ) where Date = 970714 returns 0714

mid( Date,3,2 ) where Date = 970714 returns 07

For a more complicated example, see the index function.

View solution in original post

Not applicable
Author

You're right. The two solutions are good.

thanks you

hector_obregon_
Contributor II
Contributor II

Thanks so much.