COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Ganesh Kedari on 21 Jan 2014 09:40:09 PM

Title: Combile multiple row items in a Column as comma separated values
Post by: Ganesh Kedari on 21 Jan 2014 09:40:09 PM
Hi All
   I need to show values in a particular column as comma separated values for multiple rows after Grouping.
   
   My Current list report is
   
   Row No   Item    Qty      SerialNo
   1           XXX      1      02AAAA
   2           XXX      1      03BBBB
   3           XXX      1      02CCCC
   4           YYY      1      03VVVV
   
   After Grouping I am getting output as
   
   Row No   Item    Qty      SerialNo
   1                              02AAAA
   2            XXX      1      03BBBB
   3                               02CCCC
   4             YYY      1      03VVVV
   
   Here Serial No and Row No is shown as One Per row.
   
   My target report after group should look like
   
   No   Item    Qty      SerialNo
   1   XXX      3      02AAAA,03BBBB,02CCCC
   2   YYY      1      03VVVV
   
   I tried Cross tab and Master-Details based solution given in Technote http://www-01.ibm.com/support/docview.wss?uid=swg21404363.
   But I am not able to get it as Comma separated , It still shows me as Serial no Rows wise.
   
   Please let me know your suggestions for implementing Row Number after Group and Comma separated values in List Columns.
Title: Re: Combile multiple row items in a Column as comma separated values
Post by: MFGF on 22 Jan 2014 02:45:15 AM
Hi,

Drag a repeater into your list and populate this with [SerialNo]. Go to the query of the repeater and add [Item]. Set up a master/detail between the list and the repeater based on [Item]. Finally add a text item (comma) into the repeater.

Cheers!

MF.
Title: Re: Combile multiple row items in a Column as comma separated values
Post by: sukanya on 21 Jan 2021 02:35:42 PM
Hi MF,
is there a way to remove the last comma using repeater?

Thanks
Title: Re: Combile multiple row items in a Column as comma separated values
Post by: dougp on 21 Jan 2021 06:52:16 PM
Yes.  Include another column with row number.  If the row number matches the max row number, replace the comma with a zero-length string.
Title: Re: Combile multiple row items in a Column as comma separated values
Post by: dougp on 21 Jan 2021 07:06:16 PM
https://github.com/dougpulse/Cognos/blob/master/ReportSpecifications/CommaDelimitedList.txt
Title: Re: Combile multiple row items in a Column as comma separated values
Post by: NEON81 on 24 Jan 2021 08:59:43 PM
Hey all,

I've just done a similar thing to the original poster with a repeater in Report Studio.  As soon as I add the repeater, it slows down the report significantly.  Is there any way to speed it up?  Anything else I could consider?

Thanks.