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!

Parameter on a formula field

Status
Not open for further replies.

ForMe2

Technical User
Jan 16, 2007
15
US
How do you create a parameter for a formula field? My formula field is (unit cost*qty) which creates a total cost. An example would be the user wanting to filter out any total cost under $100?
 
Depending on your database connection, you could create a SQL Expression field that does the calculation instead of using a formula. You could then use this SQL Expression in your Record Selection.

Bob Suruncle
 
Just what is 'total cost'? If it comes from a single detail line, then create a parameter and put a line in the record selection,
Code:
@MinCOst >= (unit cost*qty)

If it comes from several records, group them together, do a summary total and then use Report > Selection Formulas > Group to do a group selection. (If you're not already familiar with Crystal totals, the basics are explained at FAQ767-6524).

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
There is no special method for setting a formula equal to a parameter. You create a parameter (field explorer->parameter->new), name it "cost" and then go to report->selection formula->record and enter:

{@yourformula} < {?cost}

As Bob suggested, if you can use a SQL expression instead of the formula, you will get faster results.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top