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

Help with formula for parameter

Status
Not open for further replies.

Jonesxx

Technical User
Jul 14, 2004
71
GB
Hi
I am using Crystal 8.5,

I have a field {Sales.Type}, the Type field within the Sales table has various lookup options e.g. Coke, Fanta, Lemonade, Oranges, Mangos, Hovis, Kings Mill etc.

I need to add a parameter to the report, I would like the parameter prompt to display the following options, Drinks, Fruit, Bread. If the user selects Drinks from the parameter I want the report to bring back all records which have Coke, Fanta or Lemonade etc in the Type field. If the user selects Bread from the prompt then I would like the report to bring back all records which have Hovis, Kings Mill etc.

I’m assuming I need a formula of some sort, please help.

Thanks v m
 
I think you've received help along these lines before, and it would be better if you explained the problem you ran into in the original thread.

Anyway, set up the parameter with options: Drinks, Fruit, etc. Then write the record selection formula like:

if {?type} = "Drinks" then
{sales.type} in ["Coke","Fanta","Fresca"] else
if {?type} = "Fruit" then
{sales.type} in ["Orange","Apple", "Banana"] else
//etc.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top