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

Peachtree Crystal formula to calculate commission 1

Status
Not open for further replies.

crystalpro

Technical User
Jan 22, 2002
95
US
Commission is based on who the sales rep is and what product is sold. The item type field stores the value of "1" for one type of product and "2" for the other type of product.

The commission rate is stored in a text field for the sales rep.

I want to change the text field to a numeric field so I can multiply it by the sales amount depending on the condition if the product sold is a type 1 or 2.

Here's what I tried:
if NumericText ({Employee.CustomField1}) then ToNumber ({Employee.CustomField1});
if NumericText ({Employee.CustomField2}) then ToNumber ({Employee.CustomField2});
if {LineItem.ItemType} = "1" then {JrnlRow.Amount} * ToNumber({Employee.CustomField1}) else if {LineItem.ItemType} = "2" then {JrnlRow.Amount} * ToNumber({Employee.CustomField2})

Nothing appears in my Commission column on the report.
Any help is greatly appreciated.
 
Hi

Try your formula like this without the first two testings.

if {LineItem.ItemType} = "1" then {JrnlRow.Amount} * ToNumber({Employee.CustomField1}) else if {LineItem.ItemType} = "2" then {JrnlRow.Amount} * ToNumber({Employee.CustomField2})
else 0

let me know if you get further with this.
Eileen McEvoy
Crystal Reports Consultant and Trainer
emcevoy@crystalconsulting.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top