COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: hespora on 28 Oct 2021 09:30:14 AM

Title: Aggregating several text values into single comma separated value
Post by: hespora on 28 Oct 2021 09:30:14 AM
Hi there,


this is a list I have:

Dim1    Dim2
A       A1
A       A2
A       A3
B       B1
B       B2


and this is the list I would like as a result:

Dim1    Dim2 agg
A       A1, A2, A3
B       B1, B2


No facts involved in this, these are pure text values. The number of values for Dim2 for each Dim1 is variable.
Now, I know how to solve this by using a repeater inside a list, but that solution seems to take exponentially longer, the longer the original list is, and I'm looking for something that is purely inside a query/multiple queries if need be. Anyone got an idea?
Title: Re: Aggregating several text values into single comma separated value
Post by: CognosPaul on 31 Oct 2021 04:51:28 PM
I wrote about this years ago. Take a look here: https://cognospaul.com/2014/10/20/quickie-aggregating-text-cognos-crosstab/