Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter with 2 choices - Overdue or Within

Status
Not open for further replies.

Cores

Programmer
Oct 17, 2007
92
0
0
CA
I am new in Cognos. Please give me an idea what kind of prompt to use and how to create query calculation to filter.

I need to create a parameter Report Status. (2 choices: Due within 30 days or Overdue).

If "Due within 30 days" is chosen, then the report will return records where Due_Date (field of the report)is within 30 days of the current date. If "Overdue" is chosen then it will return records where Due_Date is less than the current date.

Thank you very much!
 
Create a value prompt (with an associated query) Then assign 2 values (use property 'static choices')

Use value Display Value
0 Due within 30 days
1 Overdue

Let us say the parameter associated with the prompt is P1

Create 2 dataqueries, identical , but with the 2 different filters
Use 2 report pages (create the report and then copy the page)

Define a render variable (boolean) and use this to render either the first or the second page. The page that is rendered will automatically trigger the right dataquery

The expression for the boolean variable would read:

ParamValue('P1') = 0

Ties Blom

 
Sorry, meant a prompt WITHOUT an associated query

Ties Blom

 
Hi Ties Blom,

Thank you for your response and so detailed explanation. I am working. But, honestly, I am so new to Cognos (having only Crystal experience)so that i have more questions. I have created value prompt and used statis choices dialog.

You are saying "create 2 dataqueries, identical". Do you mean add queries or to use in the Tool box Query Calculation or Layout Calculation?

Thanks once again
 
Well, your report will need at least 1 query to fetch and display data. We call this a dataquery (a query associated with a prompt we call a promptquery) So add a query that will fetch your data from the associated package..

Ties Blom

 
Thank you once again - the report works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top