Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

tata1488
New Contributor

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

3 Replies

Re: Merge Multiple Rows Into a single Comma Separated Row

Try this

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

Re: Merge Multiple Rows Into a single Comma Separated Row

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

tata1488
New Contributor

Re: Merge Multiple Rows Into a single Comma Separated Row

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

Community Browser