Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
arsenal83
Contributor

loading values from field

Hello,

In my source data I have field which contains values separated by comma is there any chance to do the list from such value?

Example:

I Have:

 

GROUP_1AFRICA, EUROPE
GROUP_2ASIA
GROUP_3EUROPE, ASIA

I need to have:

 

GROUP_1AFRICA
GROUP_1EUROPE
GROUP_2ASIA
GROUP_3EUROPE
GROUP_3ASIA
1 Solution

Accepted Solutions
ali_hijazi
Honored Contributor

Re: loading values from field

yes you can use Subfield

Load Filed1, subfield(Field2,',') as Field2

from source table...

5 Replies
ali_hijazi
Honored Contributor

Re: loading values from field

yes you can use Subfield

Load Filed1, subfield(Field2,',') as Field2

from source table...

Re: loading values from field

yes its possible , use the subfield function

subfield(field_name,',') as new_field

Re: loading values from field

Sample for your requirement:

Table:

LOAD Group,

  SubField(Country, ', ') as Country;

LOAD * Inline [

Group|Country

GROUP_1|AFRICA, EUROPE

GROUP_2|ASIA

GROUP_3|EUROPE, ASIA

] (delimiter is |);


Capture.PNG

Re: loading values from field

try this

LOAD Group,

          subfield(Country,',') as Country

From Table

Employee
Employee

Re: loading values from field

Yes, with the SubField() function. It will split a field based on a delimiter.

If the field is called REGIONS use:

SubField(REGIONS,',') As REGION

This will create 2 records for the value AFRICA, EUROPE with AFRICA and EUROPE in new field REGION

SubField ‒ QlikView

Community Browser