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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
abhijith28
Creator II
Creator II

trimming the field values

Please someone help with this issue.

i have a field values as:

Field Name:- String

banarus

Animal

Lib-antartica

i need the output as: "an" if i select the field "String", all other alphabets should be eliminated

2 Solutions

Accepted Solutions
shiveshsingh
Master
Master

Plz try this.

 

Keepchar(String,'ab') as String

View solution in original post

shiveshsingh
Master
Master

T:LOAD * INLINE [
F
A-Q1_asg
Bgf-Q1
lsdQ1rts
Q2-tyu
uyQ2ih
];
NoConcatenate

F:LOAD IF(WildMatch(F,'*Q1*')=1,KeepChar(F,'Q1')
,KeepChar(F,'Q2'))AS F
Resident T ;

DROP TABLE T;

View solution in original post

3 Replies
shiveshsingh
Master
Master

Plz try this.

 

Keepchar(String,'ab') as String

abhijith28
Creator II
Creator II
Author

Suppose if i want the output as:

String:

A-Q1_asg

Bgf-Q1

lsdQ1rts

Q2-tyu

uyQ2ih

if there is"Q1" in any field value, then the field name should be Q1. if Q2 then field name should be Q2.

shiveshsingh
Master
Master

T:LOAD * INLINE [
F
A-Q1_asg
Bgf-Q1
lsdQ1rts
Q2-tyu
uyQ2ih
];
NoConcatenate

F:LOAD IF(WildMatch(F,'*Q1*')=1,KeepChar(F,'Q1')
,KeepChar(F,'Q2'))AS F
Resident T ;

DROP TABLE T;