COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Nandini.t on 29 Feb 2012 03:21:34 AM

Title: Year Prompt dispaly
Post by: Nandini.t on 29 Feb 2012 03:21:34 AM
Hi all :)

I have one requirement regarding display of year in prompt.
I have Year which is in the format 'yyyymm'
the format to be viewed in prompt should be between July 1st (the year before) and June 30th (current year).
'yyyymm' format should be changed to 'dd/mm/yyyy' format.

example of how the year prompt need to be displayed:
01/07/2010 – 30/06/2011
01/07/2011 – 30/06/2012
and so on.....

pl do guide on this..
many thanks for any help :)
Title: Re: Year Prompt dispaly
Post by: Nandini.t on 29 Feb 2012 10:58:57 PM
any help :(
Title: Re: Year Prompt dispaly
Post by: CognosPaul on 01 Mar 2012 01:32:24 AM
Add a data item to the source query. Something like

'01/07/'+substring([Year]-100,1,4) + ' - 30/06/' + substring([Year],1,4)
Title: Re: Year Prompt dispaly
Post by: absriram on 02 Mar 2012 08:47:09 PM
Are you using date prompts? If so, by default the data format in the prompt will be "Jul 1, 2010".  I am not sure why you want to change formats in prompts. It is the format in the report that users generally want to control.

Sriram.
http://www.cognosonsteroids.com (http://www.cognosonsteroids.com)
Title: Re: Year Prompt dispaly
Post by: Nandini.t on 06 Mar 2012 05:06:21 AM
Hi Paul

Many thnks for your reply.
if i use this am getting error.
also how to write filter in the query on this prompt to limit the output data between 2 dates.

Please do help on this which is much needed.

Many thanks
Title: Re: Year Prompt dispaly
Post by: Nandini.t on 06 Mar 2012 05:07:33 AM
No it is not a date prompt just a value prompt.
Title: Re: Year Prompt dispaly
Post by: CognosPaul on 07 Mar 2012 01:37:06 AM
What error are you getting and what database are you using?
Title: Re: Year Prompt dispaly
Post by: Nandini.t on 07 Mar 2012 06:59:26 AM
Its throwing some sql error.

its Oracle database.
Title: Re: Year Prompt dispaly
Post by: Lynn on 07 Mar 2012 07:25:31 AM
Quote from: New@cog on 07 Mar 2012 06:59:26 AM
Its throwing some sql error.

its Oracle database.

Well that certainly narrows things down significantly  :o

You didn't answer why you are using a value prompt instead of a date prompt and you aren't really providing any details to guide people who might be able to help you.
Title: Re: Year Prompt dispaly
Post by: learnflower on 26 Mar 2012 11:23:25 PM
Hi ,

Even i am facing the same issue , can anybody have solution on this....:)
Title: Re: Year Prompt dispaly
Post by: Gyana on 27 Mar 2012 01:33:37 AM
Hey,
Instead of using one prompt, you can use two prompts.
One promp From_date & oter To_Date.

Create a QUery Q1
---------------------
Year----------------(substring(Cast(yyyymm,Char(6)),1,4)
Month--------------(substring(Cast(yyyymm,Char(6)),5,2)
Day-----------------Case When Month='07' then '01'
                                    When Month='06' then '30'
                            END

From_date------Day||'/'||Month||'/'||Year

Use a filter-----------Month='06'

Create another Query Q2
-----------------------------------
Use Same Query Item.

Filter------------Month='07'


Use these Quer in your prompt