Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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.
TextBetween(type,'From ',' to ') AS TYPE
Hope this helps,
Jason
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.
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.
You're right. The two solutions are good.
thanks you
Thanks so much.