You are viewing limited content. For full access, please sign in.

Question

Question

Travel Reimbursement Form - Tip Calculation

asked on January 14

How can I configure a Laserfiche Form to ensure that if an employee enters a tip amount exceeding 20% of the meal's total, the excess is not calculated or included in the overall total that will be reimbursed? Is this functionality achievable within Laserfiche Forms?

0 0

Replies

replied on January 14 Show version history

You could probably use the IF function in a calculation.

IF(booleanValue, value1, value2)

=Meal + IF(Tip>Meal*0.2, Meal*0.2, Tip)

OR

=SUM(Meal, IF(Tip>MULT(Meal,0.2), MULT(Meal,0.2), Tip))

 

 

5 0
replied on February 11

Thank you for the response Jason! Would I input the formula into the "Total" field or the "Tip" field? I've tried using the second formula you provided and added into the "Total" field but when I go to test the form I get an error message "this field contains a calculation error. References: Breakfast:,Tip:.

Thanks again for your help!

0 0
replied on February 18 Show version history

The Total field, and for calculations done inside of a table you also need to use INDEX for any of the table variables.

INDEX([variable],ROW())

ROW() is a function that returns the current row in the table or collection, so you can use it in a table to reference variables on the same row.

=SUM(INDEX(Meal,ROW()), IF(Tip>MULT(INDEX(Meal,ROW()),0.2), MULT(INDEX(Meal,ROW()),0.2), Tip))

Also verify your variable names.

1 0
replied on March 6

Thank you, that worked! I applied the formula you provided with INDEX and ROW, and it's calculating correctly. However, when I add a new date, it simply overwrites the tip calculations from the first date. What adjustments do I need to make so that it calculates based on the amounts entered for the new dates?

 

0 0
replied on March 6

Hi Briceida,

You'll need to use INDEX for any variable that is part of the collection; based on your screenshot and formulas, that would include the tip variables you have inside of your IF functions.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.