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

Combine formula

Status
Not open for further replies.

donnarenia

Technical User
May 28, 2010
41
US
I have the following two selection record formulas

if {?Salesperson}= "Salesperson 1" then
{CLNTCUS.~Custom3} = {?Employee} and
{@DatesRemaining} < 13.00 and
{AR.InvoiceDate} = {?Invoice Date} and
{AR.Type} = "I" else

if {?Salesperson}="Salesperson 2" then
{CLNTCUS.~Custom21} = {?Employee} and
{@DatesRemaining} < 13.00 and
{AR.InvoiceDate} = {?Invoice Date} and
{AR.Type} = "I"

How can I combine them to get Salesperson 1 and Salesperson 2 information to show on one report.
 
did you select 'allow multiple values' in your {?Salesperson} parameter?

the items you posted, are they 2 separate formula that you are placing in the details?

 
Do a formula field:
Code:
if {?Salesperson}= "Salesperson 1" then
{CLNTCUS.~Custom3} 
else if {?Salesperson}="Salesperson 2" then
{CLNTCUS.~Custom21}
This can then be included in your selection.

Or you could do it as a boolian:
Code:
({?Salesperson}= "Salesperson 1" 
and {CLNTCUS.~Custom3} = {?Employee})
or
({?Salesperson}="Salesperson 2" then
{CLNTCUS.~Custom21}= {?Employee})
Display with unselected data: it should show True when there is a match and otherwise false. And if you just write @EmployeeMatched in your selection statement you will get the selection made.



[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Yes, I did allow multiple values in my Salesperson parameter. Yes, it is two separte formals that are placed in my record selection detail.

I think I actually need it to select based on the Employee field and if that employee appears in {CLNTCUS.~Custom21}or {CLNTCUS.~Custom3}.

Is there a way to group the two fields?
 
@Madawc I understand your formula but not sure where it should go? is it a selection record formula or just a Formula field?
 
Is there a formula that I can write that will group {CLNTCUS.~Custom3} and {CLNTCUS.~Custom21}to look for the same employee in each field regardless if I select "Salesperson 1" or "Salesperson 2"

Any help will be greatly appreciated.
 
You write it as a formula field. You can then add it to your selection.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top