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.
Not applicable

How do I create a string of information from a single field?

I have individual products that have separate entries in our database for each Category the product is in:

ProductCategory
A1
A2
A3

I want a single entry for this information in a chart I'm building that just separates each Category by a comma. Something more like below. Preferably this would be built in the script so it loads in as it's own field.

ProductCategories
A1,2,3
B1,5,10

Any suggestions?

1 Solution

Accepted Solutions
mov
Esteemed Contributor III

Re: How do I create a string of information from a single field?

Use concat() function.  In the script:

LOAD

     Product,

     concat(distinct Category, ', ') as Categories

FROM (or RESIDENT...

GROUP BY Product;

3 Replies
mov
Esteemed Contributor III

Re: How do I create a string of information from a single field?

Use concat() function.  In the script:

LOAD

     Product,

     concat(distinct Category, ', ') as Categories

FROM (or RESIDENT...

GROUP BY Product;

stigchel
Honored Contributor

Re: How do I create a string of information from a single field?

In the chart with Product as Dimension use

Concat(DISTINCT Category,',')

As expression

MVP
MVP

Re: How do I create a string of information from a single field?

s2:

load * inline [

Product, Categories

A, "1,2,3"

B, "1,5,10"

];

f2:

NoConcatenate

load Product, SubField(Categories, ',') as Category

Resident s2;

Community Browser