Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Merge Multiple Rows Into a single Comma Separated Row

Hi

In a straight table, i have the below data:

NameNumberDateCostCountry
ABC Enterprise123413-JUN-18100USA
ABC Enterprise123413-JUN-18100UK
ABC Enterprise123413-JUN-18100FRANCE

If i remove the Country column, then i only get one row.

How can i add the country column and make the row comma separated so that i get only one row? like below:

NameNumberDateCostCountry
ABC Enterprise123413-JUN-18100USA,UK,FRANCE

I also need only distinct countries to be displayed.

I tried "CONCAT(COUNTRY,',') , but its not working.

Any help would be appreciated.

Thanks

Taher

4 Replies
sunny_talwar

Try this

Aggr(Concat(DISTINCT COUNTRY, ', '), Name, Number, Date, Cost)

MarcoWedel

Did you try

CONCAT(COUNTRY,',')


as expression or (calculated) dimension?


Using it as expression with Name, Number, Date, Cost as dimensions should work.



hope this helps


regards


Marco

Anonymous
Not applicable
Author

Hi Macro

I tried it as a calculated dimension initially.

But when i tried the condition suggested by Sunny in Calculated dimension, it worked fine.

Thanks

neerajthakur
Creator III
Creator III

Hi, Sunny I tried this in Qlik Sense it's not working and error is produced at first bracket itself. Please let me know if syntax needs to be different for Qlik Sense

Thanks & Regards,
Please Accepts as Solution if it solves your query.