COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: sakthi.s on 23 Jun 2009 07:34:10 AM

Title: Problem while i use case statement
Post by: sakthi.s on 23 Jun 2009 07:34:10 AM
Hi Friends,

I'm getting an error while i drag and drop a data item in the report page.
The scenario is as follows:
Table name is Customer and its attributes are Cust ID, Cust Name, Address1, Address2, Address3, Pincode, etc..
Only one value will be present in the address column for a particular customer. Ex: For customer A the address can be in Address1 or Address2 or Address3. So i'm using a case statement while i display it in report.
If i drag Cust Id and Cust Name i can able to view both the records and if i drag and drop the Address(Data Item i've created) only the Address column in the report is viewed not the Cust ID and Cust Name.
Can anybody help me out. >:(
Title: Re: Problem while i use case statement
Post by: blom0344 on 24 Jun 2009 07:59:14 AM
Not at all clear what your problem is. In any case , if only one of the 3 address fields is filled for each customer you can also concatenate the 3 using coalesce:

coalesce(addres1,'')  || coalesce(addres2,'') ||coalesce(addres3,'')

Your remark on 'both the records' is puzzling. What are you attempting to achieve?