If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Concatenate rows in one row

Started by dssd, 03 Jun 2013 12:25:58 PM

Previous topic - Next topic

dssd

Is there a way to concatenate rows of data in a column into one rwo separated by commas

Country
US
UK
China


should become    US, UK, China   as a row in the report.

Lynn


nawaz84@yahoo.com

cast ([Account_Id],varchar(10))+cast([Customer_Id],varchar(10))

Cast is used becuase account id is integer

Lynn

Quote from: nawaz84@yahoo.com on 04 Jun 2013 11:30:33 AM
cast ([Account_Id],varchar(10))+cast([Customer_Id],varchar(10))

Cast is used becuase account id is integer

:o

That will concatenate two different fields within the same row. It will not do anything to take data from multiple rows and put them into a single row.

RKMI

I agree with Lynn, her solution works. Other reply is if you want to concatenate two fields which is a different topic.  ;D

Satheesh

Hi,
      Take One more Data Item named as Country2
Write a case stmt in that Data Item using Country Key like below
Country2
case
when ( [country_key] between <starting number> and <Ending Number>) then
([Country]||', ')
end


Unlock your layout drag Repeater object and drop in your Country 2 list column(Here you hv to take country2 in place of country data item)and drag ur country2 into repeater.
you will get your expected result.


Thanx
Sateesh