COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Raghuvir on 28 May 2014 07:13:25 AM

Title: Display Null if Date has a specific value
Post by: Raghuvir on 28 May 2014 07:13:25 AM
hi all,

we are using DB2 as our data source, we have a date field in the format of yyyy-mm-dd when the value in the date field is 0100-01-01 we need to display NULL in the reports.

how we will achieve this ? please guide me with the same.

Regards
Title: Re: Display Null if Date has a specific value
Post by: Lynn on 28 May 2014 07:41:22 AM
How about a conditional style?

http://www-01.ibm.com/support/knowledgecenter/SSEP7J_8.4.0/com.ibm.swg.im.cognos.ug_rptstd_fin.8.4.0.doc/ug_rptstd_fin_id3759cr_rptstd_modrep_highlight_data_con.html%23cr_rptstd_modrep_highlight_data_cond_styles
Title: Re: Display Null if Date has a specific value
Post by: raj_aries81 on 29 May 2014 01:08:43 AM
Quote from: Raghuvir on 28 May 2014 07:13:25 AM
hi all,

we are using DB2 as our data source, we have a date field in the format of yyyy-mm-dd when the value in the date field is 0100-01-01 we need to display NULL in the reports.

how we will achieve this ? please guide me with the same.

Regards

How about using a simple case statement... Case when extract(year,[date dataitem])=0100 then null else [dataitem] end
Title: Re: Display Null if Date has a specific value
Post by: Raghuvir on 29 May 2014 04:54:48 AM
Quote from: raj_aries81 on 29 May 2014 01:08:43 AM
How about using a simple case statement... Case when extract(year,[date dataitem])=0100 then null else [dataitem] end

yah did that. Thanks for the tip.