COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sunrat on 12 Mar 2008 07:14:49 AM

Title: Cognos8 Report
Post by: sunrat on 12 Mar 2008 07:14:49 AM
Hi ,

I have list report.I want to display columns from two tables into a single column in the format like column1-coulmn2.Does anybody know the soltion for this.
Title: Re: Cognos8 Report
Post by: sspk on 12 Mar 2008 07:53:28 AM
HI
u can do like this
drag & drop a query calculation(give name)
in the expression def. type like [table 1].[data item]+'-'+[table2].[data item]
Is this ur looking for,hope this will help
Title: Re: Cognos8 Report
Post by: sunrat on 12 Mar 2008 08:12:41 AM
Thanks for the help.But the problem is that the second dataitem is a measure.so when i try to execute this it is no displaying the correct values.And the first dataitem is a normal query item.
Title: Re: Cognos8 Report
Post by: mimariposa on 12 Mar 2008 09:02:47 AM
Try and use a 'cast' function to convert the measure into a string and then concatenate with the first item.
The completed query expression should like

'[table1].[First dataitem]' + ' - ' + cast(Second dataitem,varchar(10))'

Hope this helps!!
Title: Re: Cognos8 Report
Post by: Suraj on 12 Mar 2008 11:26:52 AM
If that doesn't work, just apply cast on both sides.
Title: Re: Cognos8 Report
Post by: sunrat on 13 Mar 2008 03:32:27 AM
hi,

Thanks for the solution.It is working.But problem is that when i group this column it is showing me error.Can we group this column. :
Title: Re: Cognos8 Report
Post by: Suraj on 13 Mar 2008 10:45:30 AM
grouping should work fine.