COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS Impromptu => Topic started by: aditya on 03 Sep 2016 03:26:20 AM

Title: Concatenate
Post by: aditya on 03 Sep 2016 03:26:20 AM
Hello Techie,

Need one help!

How to concatenate same column value in impromptu report.
Scenario : I have two columns
Column1 Column2
1              A 
1              B
2               C
2                D

Expected result
Column1   Column2
1               A,B
2               C,D

Any input much appreciated
Title: Re: Concatenate
Post by: raj_aries81 on 04 Sep 2016 07:53:09 PM
One way of achieving it is using a repeater

1)Create a list object and Drag column1 into the list
2)Drag Repeater object next to the column1, repeater would be your column2 now
3)Unlock the report and Drag column2 into the repeater object. You can either include comma delimiter in the dataitem calculation or use text object
4)Use some string functions to get rid of the extra comma for the last value

Hope this helps

Regards
raj
Title: Re: Concatenate
Post by: raj_aries81 on 04 Sep 2016 09:25:40 PM
Alternate approach would be using a List & Crosstab together with a Master-Detail relation ship on Column 1 and then setting BoxType=None for Crosstab Columns and Crosstab Corner.

Please be aware of the performance implications if your data volume is huge.

Regards
Raj
Title: Re: Concatenate
Post by: aditya on 05 Sep 2016 12:14:09 AM
Thanks Raj for reply..

Here we are using Impromptu report which is a very oldest version of cognos. So, repeater and Master-detail functionality is not available there. Also, we are using ERP tool (AS400) as a datasource and created ODBC connection to connect with 'CATALOG'.


Title: Re: Concatenate
Post by: wzubke on 05 Sep 2016 07:53:28 AM
Are you able to use custom SQL to complete the group concatenation?

MSSQL can do this using FOR XML combined with STUFF()

MySQL comes with a handy group_concat() function that does this.

Hope this helps!
Title: Re: Concatenate
Post by: aditya on 05 Sep 2016 10:52:25 AM
I am using 'Impromptu report'(version 6.1.2) it is a very oldest version of cognos. We are using DB2/400 as database, through ODBC connection we have connected the database for creating 'Catalog' for reporting.
These dababase functions (i.e Group_Concat, Listagg) are not working in this version.
Also, in Impromptu report we can use only function which are available in report, we cannot add functions mannually to override SQL in report....
Title: Re: Concatenate
Post by: ARod on 19 Sep 2016 05:17:44 AM
Been a long time with Impromptu -

Can you keep your Column2 in external file and use it as Picklist prompt option for Column1 ?