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

 

Need to group similar items in a column of a second column in a single line

Started by carioca10, 03 Jun 2025 05:32:50 PM

Previous topic - Next topic

carioca10

Need to group similar items in a column of a second column in a single line  in a report.

As follows:

Input

Field A   Field B
-----------   -----------
A1             B1
A1            B2
A2            B3
A3            B4
A3      B5

It would become:

Output   
Field A      Field B
------------      -----------
A1         B1, B2
A2         B3
A3         B4, B5

Cognos Version 12.0.4

MFGF

Quote from: carioca10 on 03 Jun 2025 05:32:50 PMNeed to group similar items in a column of a second column in a single line  in a report.

As follows:

Input

Field A   Field B
-----------   -----------
A1             B1
A1            B2
A2            B3
A3            B4
A3      B5

It would become:

Output   
Field A      Field B
------------      -----------
A1         B1, B2
A2         B3
A3         B4, B5

Cognos Version 12.0.4

Hi,

I'm assuming this is a list report? You could drop a repeater into the second column of the list, and set up a master/detail link between the query of the list and the query of the repeater (based on Column A). Add Column B into the repeater (plus comma/space etc as needed).

Cheers!

MF.
Meep!

FerdH4

I see your intended example output.  Just want to ask if this kind of similar (but not same) output might be acceptable as it's easy to produce in a List report.

Field A       Field B
-----------   -----------
A1             B1
                 B2
-------------------------
A2             B3
-------------------------
A3             B4
                 B5
-------------------------

The above can be done by Grouping the first column.

I can also image a way it might be done (or at least influenced) with a long Case statement but I don't know if all of the values/variables in both columns are always known to you.