Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
slondono
Partner - Creator II
Partner - Creator II

How to divide a String

Hi everyone.

I need to separate a String that are contained in a dimension:

For example:

The dimension is 'Name'

"Edgar Allan Poe Clemm" ----> and i need to separate each name.

First LastName: Poe

Second LastName: Clemm

First Name: Edgar

Second Name: Allan.

This is obviously just an example, i have thousands of names in this format. I think one form to do that is separating with blank spaces and using 4 calculated dimensions but im not acquainted with the qlik functions for strings.

Can anyone help me?

Thanks to all, and sorry for my bad english,

1 Solution

Accepted Solutions
sunny_talwar

May be this:

Table:

LOAD SubField(Name, ' ', 1) as [First Name],

  SubField(Name, ' ', 2) as [Second Name],

  SubField(Name, ' ', 3) as [First LastName],

  SubField(Name, ' ', 4) as [Second LastName];

LOAD * Inline [

Name

Edgar Allan Poe Clemm

];


Capture.PNG

View solution in original post

5 Replies
sunny_talwar

May be this:

Table:

LOAD SubField(Name, ' ', 1) as [First Name],

  SubField(Name, ' ', 2) as [Second Name],

  SubField(Name, ' ', 3) as [First LastName],

  SubField(Name, ' ', 4) as [Second LastName];

LOAD * Inline [

Name

Edgar Allan Poe Clemm

];


Capture.PNG

maxgro
MVP
MVP

you can start with the substring function, like that (example for the load script, subfield works in chart too)

load

  string,

  SubField(string, ' ', 1) as s1,

  SubField(string, ' ', 2) as s2,

  SubField(string, ' ', 3) as s3,

  SubField(string, ' ', 4) as s4

inline [

string

Edgar Allan Poe Clemm

a b c d

];

slondono
Partner - Creator II
Partner - Creator II
Author

It works Thanks to you and maxgro

sunny_talwar

Awesome.

If you got what you were looking for, would you be able to close the thread by marking correct and helpful answers.

Best,

Sunny

MarcoWedel

Hi,

another solution could be:

QlikCommunity_Thread_198268_Pic1.JPG

QlikCommunity_Thread_198268_Pic2.JPG

LOAD *,

    SubField([Full Name],' ') as Name,

    Dual(AutoNumber(RowNo(),RecNo())&'. Name',AutoNumber(RowNo(),RecNo())) as NameNum

Inline [

    Full Name

    Edgar Allan Poe Clemm

    Samuel Langhorne Clemens

    Charles John Huffam Dickens

    Arthur Ignatius Conan Doyle

];

hope this helps

regards

Marco