Author Topic: Aggregating several text values into single comma separated value  (Read 483 times)

Offline hespora

  • Statesman
  • ******
  • Join Date: Nov 2015
  • Posts: 394
  • Forum Citizenship: +23/-0
Hi there,

this is a list I have:

Code: [Select]
Dim1    Dim2
A       A1
A       A2
A       A3
B       B1
B       B2

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

Code: [Select]
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?

Offline CognosPaul

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Jan 2009
  • Posts: 1,901
  • Forum Citizenship: +268/-1
    • Paul's Cognos Blog