Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Search in a string and pick up a word

Hi there,

 

is there a way to search into a column in qlikview and pick up a word and create a new column which got the field value?

Tab1:

LOAD * INLINE [
id, description
1, Balsasa sadadssa TSA000123 DADSADSADADA
2, TSA00002345 BABSDBABDSABDSABDSABDBSAD
3, DSAHDSADASBDSA - TSA0004567
4, DJSADJSADJSA:tsa00023435
];

I want a to create a new field in a new table where I call it TSA and my new table to look like this

Tab2:

id,

description,

tsa

resident Tab1;

 

The tsa column need to look something like this : TSA000123 , TSA00002345 , TSA0004567, tsa00023435.

 

Can someone help me with that ?

 

Many thanks C!

 

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: Search in a string and pick up a word

it was tricky, but it works and results in 4 rows with column origin description and wanted column starting with tsa

Tab1:
LOAD * INLINE [
id, description
1, Balsasa sadadssa TSA000123 DADSADSADADA
2, TSA00002345 BABSDBABDSABDSABDSABDBSAD
3, DSAHDSADASBDSA - TSA0004567
4, DJSADJSADJSA:tsa00023435
];

Tab2:
NoConcatenate load
id,
description,
if (index(Tmpdescr,' ')=0, Tmpdescr,mid(Tmpdescr, 1, index(Tmpdescr,' '))) as DESCRIPTION
;
load
id,
description,
mid(description, index(lower(description), 'tsa'),12) as Tmpdescr
resident Tab1;

drop table Tab1;

View solution in original post

1 Reply
Highlighted
Partner
Partner

Re: Search in a string and pick up a word

it was tricky, but it works and results in 4 rows with column origin description and wanted column starting with tsa

Tab1:
LOAD * INLINE [
id, description
1, Balsasa sadadssa TSA000123 DADSADSADADA
2, TSA00002345 BABSDBABDSABDSABDSABDBSAD
3, DSAHDSADASBDSA - TSA0004567
4, DJSADJSADJSA:tsa00023435
];

Tab2:
NoConcatenate load
id,
description,
if (index(Tmpdescr,' ')=0, Tmpdescr,mid(Tmpdescr, 1, index(Tmpdescr,' '))) as DESCRIPTION
;
load
id,
description,
mid(description, index(lower(description), 'tsa'),12) as Tmpdescr
resident Tab1;

drop table Tab1;

View solution in original post