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

Trying to sum by type

Status
Not open for further replies.

frankone

Vendor
Aug 3, 2002
21
0
0
US
What I am trying to accomplish is to sum all credit card
types into one field, when I use the formula it also
included checks which I do not want. Each field(custivn.MethPay1) can have a different type of payment,.



IF {custinv.MethPay1} = "Amex" or {custinv.MethPay1} = "Master Card" or {custinv.MethPay1} = "Visa" or
{custinv.MethPay2} = "Amex" or {custinv.MethPay2} = "Master Card" or {custinv.MethPay2} = "Visa" or
{custinv.MethPay3} = "Amex" or {custinv.MethPay3} = "Master Card" or {custinv.MethPay3} = "Visa"


THEN Sum([{custinv.InvPaid1},{custinv.InvPaid2},{custinv.InvPaid3}])

ELSE 0
 
Your formula is analyzing the current row only, not all rows.

Try creating 3 formulas of:

//@sm1
if {custinv.MethPay1} in ["Amex", "Master Card", "Visa"] then
{custinv.InvPaid1}
else
0

//@sm2
if {custinv.MethPay2} in ["Amex", "Master Card", "Visa"] then
{custinv.InvPaid2}
else
0

////@sm3
if {custinv.MethPay3} = in ["Amex", "Master Card", "Visa"] then
[{custinv.InvPaid3}
else
0

Then use a formula of:

sum({@sm1}+{@sm2}+{@sm3})

This assumes that the numbers at the end of the MethPay and the InvPaid correspond.

-k
 
This formula does not work I am using Ver 8.5 of crystal
The error message I get is "Remaining text does not
appear to be part of formula. This appears after
//@sm2

Thank You!
 
There are 3 formulas, which isn't working?

At least take the time to post what you tried...

-k

 
Sorry! Here are the formulas I used
sm1
if {custinv.MethPay1} in ["Amex","Master Card","Visa"] then {custinv.InvPaid1}
else
0
I did the same for sm2 & sm3

then I set up sum123 formula

sum123
sum({@sum1}+{@sum2}+{@sum3})
this is where the following message occurs
"The Summary/Running total field count not created.
 
Use the following formula for a detail level sum (per row):

{@sum1}+{@sum2}+{@sum3}

Then you can right click on this and insert a summary (sum) at the group or report level.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top