Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ishanbansal1204
Contributor III
Contributor III

Display the row values as comma separated column values.

Hi Experts,

I have a table created in Qlik sense and it has 10 columns and there is a requirement to add another column which has multiple values.

Based on the ID which is one of the column , I have to add another column and the values should be comma separated. Is there a way I can solve this by the formula in expression?

Current

IDTID
1123
1456
2963
2258
2741
3789
3654
3123
3951

Expected

IDTID
1123,456
2963,258,741
3789,654,123,951

I used the below query in dimension expression

=concat(TID,',')

But its giving me an error saying invalid dimension.

Thanks,

Ishan

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Now it's clear. Try:

Straight table:

Dim: ID

Exp: Concat( Distinct TID, ',')

If you are using as calculated dimension, try like:

=Aggr(Concat(Distinct TID, ','), ID)

View solution in original post

7 Replies
tresesco
MVP
MVP

Possibly there is a way. And that could be suggested, if you could explain your requirement in bit more details; may be with an example with sample data.

tresesco
MVP
MVP

What if you try using like: = ID & ' , ' & TID

Anonymous
Not applicable

Hello Ishan,

Use the below expression as calculated dimension.

AGGR(Concat(DISTINCT TID,','),ID)

tresesco
MVP
MVP

Now it's clear. Try:

Straight table:

Dim: ID

Exp: Concat( Distinct TID, ',')

If you are using as calculated dimension, try like:

=Aggr(Concat(Distinct TID, ','), ID)

ishanbansal1204
Contributor III
Contributor III
Author

Thank you very Much. This is what I was looking for.

ishanbansal1204
Contributor III
Contributor III
Author

In your expression you have grouped by ID. If we have 2 values to group what will be the expression?

tresesco
MVP
MVP

Check aggr() on help. It would be something like: Aggr( Concat(....), Dim1, Dim2)