Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Not applicable

split a string

Hi,

I want to split a string and need to take first word and save it like a row and also do these for teh second and third and fouth row

ex:

INCIDENTE.ACCESO.BLOQUEO DE CUENTA.DIRECTORIO ACTIVO

INCIDENTE  |ACCESO       | BLOQUEO DE CUENTA| DIRECTORIO ACTIVO

INCIDENTE  |APLICACION| NEWHOTEL                     | ACCESO

thanks

7 Replies
danielrozental
Honored Contributor II

Re: split a string

try subfield

subfield(FIELD,'|') AS SOMETHING

Re: split a string

HI

Try something like this

=SubField('INCIDENTE.ACCESO.BLOQUEO DE CUENTA.DIRECTORIO ACTIVO','.',1) gives INCIDENTE

=SubField('INCIDENTE.ACCESO.BLOQUEO DE CUENTA.DIRECTORIO ACTIVO','.',2) gives ACCESO

Hope it helps

Not applicable

Re: split a string

THANKS, BUT I NEED THAT EVERY ROW SAVE IN A DIFFERENT FIELD LIKE:

CATEGORIA1

==========

INCIDENTE

REUQEIRMIENTO

CATEGORIA2

==========

ACCESO

APLICACION

CATEGORIA3

===========

BLOQUEO DE CUNETA

NEWHOTEL

.

.

.

I HAVE THIS FIELD LIKE THIS INCIDENTE.ACCESO.BLOQUEO DE CUENTA.DIRECTORIO ACTIVO, BUT I NEED IT  LIKE I MENTION BEFORE. PLEASE HELP ME

Highlighted

Re: split a string

Hi

Load *,

SubField('INCIDENTE.ACCESO.BLOQUEO DE CUENTA.DIRECTORIO ACTIVO','.',1) as CATEGORIA1,

SubField('INCIDENTE.ACCESO.BLOQUEO DE CUENTA.DIRECTORIO ACTIVO','.',2) as CATEGORIA2

from table;

Hope it helps

Not applicable

Re: split a string

AND HOW CAN I PUT INCIDENTE AND REQUERIMIENTO IN CATEGORIA1???, BECAUSE IT RESULT BUT IT PUT THE CATEGORY EN DIFERENTS ROWS LIKE

CATEGORIA1

INCIDENTE

CATEGORIA2

REQUERIMIENTO

HOW CAN I PUT IT LIEK THIS

CATEGORIA1

INCIDENTE

REQUERIMIENTO

THANKS

Re: split a string

HI

where you taken the value as  'REQUERIMIENTO' ? can  i know it?

If you want all values as single field?

Not applicable

Re: split a string

Daniel & Mayil pointed you in the right direction. below are your strings and a few test strings...to get Category1 to have INCIDENTE, INCIDENTE2, INCIDENTE3, REUQEIRMENTO....In your app, where are you reading this string from ? If there are just a few lines you can put them in an inline table and use it like below...

Tmp:

Load * Inline [

String

INCIDENTE.ACCESO.BLOQUEO DE CUENTA.DIRECTORIO ACTIVO

INCIDENTE2.ACCESO2.Test2 DE CUENTA.DIRECTORIO ACTIVO2

INCIDENTE3.ACCESO3.Test3 DE CUENTA.DIRECTORIO ACTIVO3

REUQEIRMIENTO.APLICACION.NEWHOTEL.DIRECTORIO ACTIVO4

];

Categories:

Load

Subfield(String, '.',1) as Category1,

Subfield(String, '.',2) as Category2,

Subfield(String, '.',3) as Category3,

Subfield(String, '.',4) as Category4

Resident Tmp;

Drop Table Tmp;