Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Get part of a string

Hi Everyone,

I have two fields that mean the same from 2 different tables, but are not the same in characters.

The first one is like ODI-1, the second one is like [#ODI-1].

I have tried mid(field, 3, 5) and that works for now. But what do to when we reach [#ODI-10]  until [#ODI-99] or higher?

Or is there maybe another way to connect these fields because they mean the same?

15 Replies
SunilChauhan
Champion
Champion

may be this

subfield(subfield(fieldname,'#',2) ,'-',1)

Sunil Chauhan
Not applicable
Author

And how about addin [#] to the first table? Don't know how that works. But the first table field only contains abc-1 and so on.

Not applicable
Author

Hi Sunil,

That doesn't work. Would be nice if it would though.

swuehl
MVP
MVP

LOAD

...

'[#' & FIELD & ']' as FIELD,

...

from Table1;

edit: Have you tried the purgechar() ?

SunilChauhan
Champion
Champion

for first table use can use

fieldname  as somename

and in second Table

use this

subfield(fieldname,'#',2)  as somename

hope this helps

Sunil Chauhan
Not applicable
Author

Thanks swuehl, that worked. Now I have the same fields. Thanks all!