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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need assistance with a parameter (range) 1

Status
Not open for further replies.

ncchish

Programmer
Jul 29, 2002
86
US
I'm trying to set up a parameter where the user selects a range. For example, the choices would be $5,000 & up; $10,000 & up; $20,000 & up; $50,000 & up or "All". This is what I have in my record selector (Crystal 8.5) so far:

if {?Target} in [5000, 10000,20000, 50000]
then
{AGMRV_APPLIED_SMRY.APPL_MTD_PREM_AMT} >= {?Target} and

It will run set up like this but the output is not correct. The numbers don't match the current report and it does match when I comment the change. Also, I can't get the "All" selection to work. The report times out.

Can anyone help? Thanks in advance.


ncchish
 
I think you want to change your selection to this:
Code:
(
if {?test} = "$5,000 & up" then
    {Customer.Last Year's Sales} >= 5000
else if {?test} = "$10,000 & up" then
    {Customer.Last Year's Sales} >= 10000
else if {?test} = "$20,000 & up" then
    {Customer.Last Year's Sales} >= 20000
else if {?test} = "$50,000 & up" then
    {Customer.Last Year's Sales} >= 50000
else if {?test} = "All" then
    True
)
and
I assume you left the "and" at the end since you had more criteria to apply so I tacked it on for that reason.

~Brian
 
Set your parameter up with a Number datatype. Enter your default parameters like this:
[tt]
Value Description
----- -----------
-99 ALL
5000 $5,000 & up
10000 $10,000 & up
20000 $20,000 & up
50000 $50,000 & up
[/tt]
Set the Display of the parameter field to "Description".

Your Record Selection Formula would then look like this:
[tt]
(If {?Target} <> -99 Then
{Customer.Last Year's Sales} >= {?Target}
Else If {?Target} = -99 Then True)
[/tt]
-dave
 
vidru*:

Nice solution. I tend to forget about the Description portion of the parameters. Thanks for the reminder ;)

~Brian
 
Brian,

Thanks for that. I'd just noticed that we'd both used the Customer table from the Xtreme db for testing, and chuckled to myself a bit ;)

-dave
 
Thank you both for responding. Unfortunately, when I tried the second suggestion I got the exact same output as I did when I used my selection criteria. When I remove the selection my output matches what is currently in production. I thought there was something wrong with my selection but using your suggestion gives me the same wrong output. I don't know what the problem is. I will try bdreed35's selection and see what I get.

Thanks.
 
I got the same results using all 3 versions but they don't match production so something's not right. I will keep looking. Thanks for your help.
 
Don't know if this is relevant, but the solutions above are based on a single, discrete parameter, not a range parameter. You don't really need a range parameter, just a number parameter where you can describe that you mean greater than or equal to the value.

-LB
 
The record selection formula looks fine based on the requirements you've posted, I'd guess thta Production has additional criteria or different joins on the tables.

See if you can obtain the SQL the production report uses and compare it.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top