5 Replies Latest reply on Mar 7, 2016 12:45 PM by tokuyama

# Function if

Hi, I need help.

I am trying to create the script to apply the selection of the discount for 10%, 20%, and 30% off for the total of credit card total.

Which function should I use?

Ex Total of Credit Card: \$100.00

If Discount %:10%

Grand Total: \$90.00

Ex Total of Credit Card: \$100.00

If Discount %:20%

Grand Total: \$80.00

Ex Total of Credit Card: \$100.00

If Discount %:30%

Grand Total: \$70.00

Thank you very much.

• ###### 1. Re: Function if

you don't really need a script, just another field. It sounds like you already have a "subtotal" and "discount" field that have data in them, so just create a "grand total" calculation field that is:

subtotal - (subtotal * discount)

replace subtotal and discount with the names of your fields and you should be good to go.

• ###### 3. Re: Function if

As above, I would like to have multiple discounts.

If (Payment = "Cash";Service total + Product Total -

If (Promotion="10% Stamp";Round (Service total * .1;0)

10% off is working with the script shown above, but I don't know how to add 20% Card and 20% Stamp.

Thank you

• ###### 4. Re: Function if

Try the Case() function for multiple "if" conditions.

Modifying your code would look like this:

tokuyama wrote:

As above, I would like to have multiple discounts.

If (Payment = "Cash"; Service total + Product Total -

Case (

Promotion="10% Stamp"; Round (Service total * .1 ; 0) ;

Promotion="20% Stamp"; Round (Service total * .2 ; 0) ;

Promotion="20% Card"; Round (Service total * .2 ; 0) ;

0

)

)

• ###### 5. Re: Function if

Hi,

thank you very much.

It worked!!!