Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
muniyandi
Contributor III

how to split the data into new record

Hi Team,

i have source table record like this

Source Records
"AA"-"AB"-"CC"-"DD"
"AM"-"AD"
"AH"-"AN"-"BL"

I need to load the data below mentioned format.

Expected Result
AA

AB

CC
DD
AM
AD
AH
AN
BL
1 Solution

Accepted Solutions

Re: how to split the data into new record

try this

Subfield(keepchar(Field,'ABCDEFGHIJKLMNOPQRSTUVWXYZ-'),'-') as Result

View solution in original post

5 Replies

Re: how to split the data into new record

May be try this:

PurgeChar(SubField(Source, '-'), Chr(34)) as Expected

Re: how to split the data into new record

For your sample:

Table:

LOAD *,

  PurgeChar(SubField([Source Records], '-'), Chr(34)) as Expected;

LOAD * INLINE [

    Source Records

    '"AA"-"AB"-"CC"-"DD"'

    '"AM"-"AD"'

    '"AH"-"AN"-"BL"'

];

Capture.PNG

muniyandi
Contributor III

Re: how to split the data into new record

Thanks Sunny T

Some data have number also

"AH#2"-"AN#6"-"BL#8"



Re: how to split the data into new record

Would this be the output you would want to see?

Capture.PNG

Still using the same script:

Table:

LOAD *,

PurgeChar(SubField([Source Records], '-'), Chr(34)) as Expected;

LOAD * INLINE [

    Source Records

    '"AA"-"AB"-"CC"-"DD"'

    '"AM"-"AD"'

    '"AH"-"AN"-"BL"'

    '"AH#2"-"AN#6"-"BL#8"'

];

Re: how to split the data into new record

try this

Subfield(keepchar(Field,'ABCDEFGHIJKLMNOPQRSTUVWXYZ-'),'-') as Result

View solution in original post