Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
robert2012
Contributor III
Contributor III

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,

View solution in original post

trdandamudi
Master II
Master II

Try to use Subfield...

stigchel
Partner
Partner

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

SubField(Key,'_',1)

SubField(Key,'_',2)

SubField(Key,'_',3)

MindaugasBacius
Partner
Partner

Take a look to Subfield function:

SubField ‒ QlikView

Chanty4u
Champion III
Champion III

try below

a:

LOAD * INLINE [

    Data

  ABC34_2324_234234234

];

Result:

LOAD *,

SubField(Data,'_') as key

Resident a;

sub.PNG

Not applicable

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