Topic
2 replies Latest Post - ‏2013-10-23T13:28:20Z by kgcognos
kgcognos
kgcognos
17 Posts
ACCEPTED ANSWER

Pinned topic Drop Down Values

‏2013-10-22T17:07:34Z |

I have a year parameter. I only want the (current year and previous year) OR (current year and next year) depending on the current month to show on the drop down.
Please help on how I can accomplish this. What prompt property setting should I change?

Also, I'm trying to get the current year. I'm using cast(extract(year,current_timestamp),varchar(4)) in the report expression but the validation keeps on failing. How do I extract a year in Report Expression when defining a variable? 
Thank you in advance.

  • Ba-al
    Ba-al
    51 Posts
    ACCEPTED ANSWER

    Re: Drop Down Values

    ‏2013-10-23T08:05:26Z  in response to kgcognos

    So do as you write

    ([year] in (?Year?;?Year?+1) and ?Month? in (7;8;9;10;11;12)) or ([Year] in (?Year?;?Year?-1) and ?Month? in (1;2;3;4;5;6))

    Your statement is fine for Query Calculation

    • kgcognos
      kgcognos
      17 Posts
      ACCEPTED ANSWER

      Re: Drop Down Values

      ‏2013-10-23T13:28:20Z  in response to Ba-al

      Thanks I'm new to COGNOS. I know how to code to calculate the year but I don't know where to put it.

      Please assist to where in the prompt property should I put my code so that it will display the years that I need in the drop down? 

      Where do I build the years? Do I need a data item or variable?