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: 
Anonymous
Not applicable

Devide a key

Hi all,

i build a "key" like ABC34_2324_234234234.

Now I want to devide it like:

ABC34

2324

234234234


I did this with left(key, 5) as Key 1

etc.


I wanted to ask if it is possible to devide by using "_" so that the lenght of each key doesn't matter.


Thank you fpr helping!

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

subfield(Key,'_',1) as Key1,

subfield(Key,'_',2) as Key2,

subfield(Key,'_',3) as Key2,

View solution in original post

6 Replies
m_woolf
Master II
Master II

subfield(Key,'_',1) as Key1,

subfield(Key,'_',2) as Key2,

subfield(Key,'_',3) as Key2,

trdandamudi
Master II
Master II

Try to use Subfield...

stigchel
Partner - Master
Partner - Master

You can use the function SubField() e.g.

SubField(Key,'_',1)

SubField(Key,'_',2)

SubField(Key,'_',3)

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

Take a look to Subfield function:

SubField ‒ QlikView

Chanty4u
MVP
MVP

try below

a:

LOAD * INLINE [

    Data

  ABC34_2324_234234234

];

Result:

LOAD *,

SubField(Data,'_') as key

Resident a;

sub.PNG

Not applicable
Author

Hi,

Try using the SubField function. Something like this:

Key1 = SubField( key,'_')

Something I just learned recently.


With this function you can even pull out the next field as in:

Key2 = SubField( key,'_',2)

Hope this is what you need!

- Stan