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

Formula Needed For Parameter

Status
Not open for further replies.

Jonesxx

Technical User
Jul 14, 2004
71
GB
Hi,

I am using Crystal 8.5 and I need help with a formula.

I have a report which uses only one table the table is called 'Results'. I have put some parameters on the report so the users will be prompted to enter criteria based on e.g Lunch Meeting, Proposal Date. Excluding these two options mentioned there are also 4 other options, however I would like the 4 remaining choices to appear as 'Other'. So basically from the parameter prompt the user will see the options Lunch Meeting, Proposal date, Other.

Can you please help with the formula syntax as I keep on getting a message saying that the array must be subscripted. Here is the formula I have created:

(if {?Outcome} in ["F", "T", "O", "D"] then 'Other' else {Results.Ref})

Thanks
 
This means that {?Outcome} is a multi-value parameter, and the formula is looking for one element of the array to test. To test the entire array, try this:

if
(instr(join({?Outcome},""),"F")>0 or
instr(join({?Outcome},""),"T")>0 or
instr(join({?Outcome},""),"O")>0 or
instr(join({?Outcome},""),"D")>0)

Then "other" else {Results.Ref}




Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"making predictions is tough, especially about the future" - Yogi Berra
 
I think your record selection formula should be:

if {?Outcome} = "Other" then
{Results.Ref} in ["F", "T", "O", "D"] else
{Results.Ref} = {?Outcome}

Then if you want to insert a group based on these options, then insert a group on a formula like:

if {Results.Ref} in ["F", "T", "O", "D"] then "Other" else {Results.Ref}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top