Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All
I have a field with values like below
1234-abc
13422-monday
136647536-tuesday
I need to display only the part before '-'
eg) 1234 , 13422, 136647536.
Kindly help me what function I can use to get above result.
Thanks in advance...
Yes,U can use it in front end also.
better way is create in script level to use further .
Hope this help
Hi,
Use below script.
Tab:
LOAD * Inline [
FiledName
1234-abc
13422-monday
136647536-tuesday];
Tab1:
LOAD
KeepChar(FiledName,'0123456789') as FiledName1
Resident Tab;
use Keepchar in your script
KeepChar(YourFiled,'0123456789') as YourFiled
Where exactly in front end?? Please helo..
Hi
U can Use this if its suits ur scenario
=KeepChar('1234-abc',0123456789)
or
=SubField('1234-abc','-',1)
You mentioned to use in expression. But the field is a dimension.
Yes. Give me some time. I am trying the sokution. Will inform once it is sccessful..
Hello Sunny
SubField(FieldName, '-', 1) as FieldName
Above is not working for me in the script.
You can use the funciton SubField, check the attached document to see how it works.
Qlikview Help:
subfield(s, 'delimiter' [ , index ] )
In its three-parameter version, this script function returns a given substring from a larger string s with delimiter 'delimiter'. index is an optional integer denoting which of the substrings should be returned. If index is omitted when subfield is used in a field expression in a load statement, the subfield function will cause the load statement to automatically generate one full record of input data for each substring that can be found in s.
In its two-parameter version, the subfield function generates one record for each substring that can be taken from a larger string s with the delimiter 'delimiter'. If several subfield functions are used in the same load statement, the Cartesian product of all combinations will be generated.
Examples:
(For three parameters)
subfield(S, ';' ,2) returns 'cde' if S is 'abc;cde;efg'
subfield(S, ';' ,1) returns NULL if S is an empty string
subfield(S, ';' ,1) returns an empty string if S is ';'