COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: satya0320 on 03 Nov 2011 09:26:09 AM

Title: Dynamically change every month in dropdown value prompt.
Post by: satya0320 on 03 Nov 2011 09:26:09 AM
Hi All,

How to dynamically change of month in dropdown list in value prompt using java script in report studio?


Venkat B.
Title: Re: Dynamically change every month in dropdown value prompt.
Post by: blom0344 on 03 Nov 2011 09:32:20 AM
"Change of month"
In what way?  Based on which logic?
Can you be more specific?
Title: Re: Dynamically change every month in dropdown value prompt.
Post by: satya0320 on 03 Nov 2011 09:50:38 AM
Use Value    Display Value
-------------   -----------------
1                   Jan
2                   Feb
'' ''                 '' ''
12                 Dec             

These like in value prompt, but every current month willbe show that month only in value prompt.
Title: Re: Dynamically change every month in dropdown value prompt.
Post by: blom0344 on 03 Nov 2011 10:43:49 AM
Don't need any java code for that.

Define a prompt query with 3 dataitems:

1. extract(month,current_date)   -->  use value

2. case extract(month,current_date)
    when 1 then 'Jan'
    when 2 then 'Feb'
    ......
    when 12 then 'Dec'
    else null end                        -->  display value

3. maximum([any other dataitem from model])

This should yield one (1) record for populating the valueprompt