COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Report Studio => Topic started by: cognos_developer on 01 Jun 2011 09:58:49 AM

Title: Removing duplicate values in drop down list.
Post by: cognos_developer on 01 Jun 2011 09:58:49 AM
Hi friends,

I have data like 2011-5-1
                        2011-5-2
                        2010-4-23
                        2010-4-21
So,when I am populating the values in drop down value prompt in MM format values are repeating and showing as
                  2011-5
                  2011-5
                  2010-4
                  2010-4
I want to eliminate duplicate values and show only unique values.Please suggest me is there a way for this.
Note:-I do not want to use javascript in my Report.

Thanks
Title: Re: Removing duplicate values in drop down list.
Post by: MFGF on 02 Jun 2011 05:19:59 AM
I suspect the issue is that you are simply using formatting to change the date display, so behind the scenes the values are still different.  You could try using a calculated item to reformat the dates to the form you require - use fully qualified item names from the package to set the timing to before auto grouping/aggregation.

Regards,

MF.
Title: Re: Removing duplicate values in drop down list.
Post by: PRIT AMRIT on 03 Jun 2011 12:32:46 AM
QuoteI have data like 2011-5-1
                        2011-5-2
                        2010-4-23
                        2010-4-21
So,when I am populating the values in drop down value prompt in MM format values are repeating and showing as
                  2011-5
                  2011-5
                  2010-4
                  2010-4
I want to eliminate duplicate values and show only unique values.Please suggest me is there a way for this.
Note:-I do not want to use javascript in my Report.

As MF suggested create another DATA ITEM in your prompt query, with an expression like

[Calculated Date]
---------------------
cast(extract(Year,[Date]),char(4))+'-'+cast(extract(Month,[Date]),char(2))

Select the Value Prompt and define Use Value =[Calculated Date]

Use the same [Calculated Date] in you main query to filter the report

[Calculated Date]=?Parameter?

Hope it helps

Thanks