Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Guiqiang
New Contributor II

Split line in script

Hello everyone, how to write a script to turn T1 into T2. thanks.

t1:  

monlyvalues
201701AA
201702BB,CC

t2:

   

monlyvalues
201701AA
201702BB
201702CC
Tags (1)
5 Replies
francescoreggia
New Contributor III

Re: Split line in script

Try

load

monly,

subfield(values,',') as values

resident t1;

Guiqiang
New Contributor II

Re: Split line in script

good, thank you! 

ishanbhatt
Contributor II

Re: Split line in script

Hi guiqiang,

For splitting the values in Qlik we have 'Subfield' function.


Subfield format:

Subfield (text, delimiter, field_no)

or

Subfield (FieldName, delimiter, field_no),

Now Let's talk about your table.

Subfield(Values,',',1) as Values

It is better to define field_no in the third parameter.

I have also attached example app. Hopefully, this will solve your problem.

Guiqiang
New Contributor II

Re: Split line in script

I see, thank you very much.

ishanbhatt
Contributor II

Re: Split line in script

Please mark as correct if you reach your solution.

Thanks.

Community Browser