Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Anonymous
Not applicable
Author

Use concat() function.  In the script:

LOAD

     Product,

     concat(distinct Category, ', ') as Categories

FROM (or RESIDENT...

GROUP BY Product;

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Use concat() function.  In the script:

LOAD

     Product,

     concat(distinct Category, ', ') as Categories

FROM (or RESIDENT...

GROUP BY Product;

stigchel
Partner - Master
Partner - Master

In the chart with Product as Dimension use

Concat(DISTINCT Category,',')

As expression

maxgro
MVP
MVP

s2:

load * inline [

Product, Categories

A, "1,2,3"

B, "1,5,10"

];

f2:

NoConcatenate

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

Resident s2;