COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Arsenal on 28 Mar 2007 08:34:15 PM

Title: Using a prompt value to populate rows
Post by: Arsenal on 28 Mar 2007 08:34:15 PM
Hi everyone,

The situation is, I have to have a list report with a few columns. Let's say for simplicity sake, that I have a date, quantity1, quantity 2 and quantity 3 columns in the report.

The report must first prompt for a beginnng and ending transaction date, which is simple enough. The report must then prompt the user to input a number. Now, if any one of the quantities (from quantity 1, quantity 2, quantity 3) is greater than this inputted number, then the entire row must be displayed - i.e. if the inputted number was 100 and say for a row the quantity 1 had a value of 40, quantity 2 of 60 and quantity 3 of 120, then quantity 3 exceedes the inputted 100, hence the entire row must be displayed, including quantity 1 and quantity 2, even though just quantity 3 exceeded the inputed number.

I think one way of doing this is to have in the expression, for each of the 3 quantity columns, something like IF (quantity1 > prompt2) or if (quantity2> prompt2) or if(quantity 3> prompt 2) then (quantity 1) else (0) and so on for the other 2.

question is, is there a better way to do this, rather than have literally 9 IF conditions between the 3 quantities?

Help and suggestions greatfully acknowledged.
Title: Re: Using a prompt value to populate rows
Post by: COGNOiSe administrator on 28 Mar 2007 09:47:53 PM
Just use a simple filter:

quantity1 > ?promptNameHere? or quantity2 > ?promptNameHere? or quantity3 > ?promptNameHere?
Title: Re: Using a prompt value to populate rows
Post by: Arsenal on 28 Mar 2007 10:17:09 PM
Cognoise, thanks for your prompt response.

I take it you mean that I should use a detail filter in query 1 witn an expression similar to the one you  used?
Title: Re: Using a prompt value to populate rows
Post by: COGNOiSe administrator on 29 Mar 2007 02:25:09 AM
That would be correct.
Title: Re: Using a prompt value to populate rows
Post by: Arsenal on 29 Mar 2007 08:30:07 PM
Thank you very much for your help.

Been working fine, I believe :)