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

Question

Question

Formulas within Tables

asked on February 3, 2022

I am using LF Forms Professional Version 10.4.1.  There is a table I am using that I want the user to fill out columns  depth, width and length.  There is another column for square feet that I want to fill by multiplying  length and width.

 

I used the following question as a model https://answers.laserfiche.com/questions/110762/Error-in-table-when-calculating-Line-Total#110858.

 

I have tried the following with both MULT and PRODUCT in the Sq Feet formula field.

 

=MULT
(
INDEX(Cuts_and_Trenches.Length,ROW()),
INDEX(Cuts_and_Trenches.Width,ROW())
)

 

=MULT
(
IF(INDEX(Cuts_and_Trenches.Length,ROW())="",0,INDEX(Cuts_and_Trenches.Length,ROW())),
IF(INDEX(Cuts_and_Trenches.Width,ROW())="",0,INDEX(Cuts_and_Trenches.Width,ROW()))
)

 

=IF(INDEX(Cuts_and_Trenches.Length,ROW())="",0,INDEX(Cuts_and_Trenches.Length,ROW())) *IF(INDEX(Cuts_and_Trenches.Width,ROW())="",0,INDEX(Cuts_and_Trenches.Width,ROW()))

 

TableFormulasLF.jpg
Error.jpg
Error.jpg (33.69 KB)
0 0

Answer

SELECTED ANSWER
replied on February 4, 2022

Now double check the variable names.  If you change field types its going to create new variables names.

 

My variable names are not the same as yours but here it is working with the formula

 

=MULT(INDEX(Table_1.Length,ROW()),INDEX(Table_1.Width,ROW()))

 

1 0

Replies

replied on February 3, 2022

Your first equation works.  Are all the fields number fields?  If they are single lines it's not going to work.  If you go with the first formula its going to error unless there are two numbers in it.  You can default them to 0 to avoid that or setup the field rule to do nothing if one of the values is empty.  But check if all the fields involved in the calculation (including sq feet) are number fields.

1 0
replied on February 3, 2022

Thank you, not all field types were set to Number. I set them all to number and set the default values for Length and Width to 0 but it still doesn't seem to calculate.

Still using the formula below. When I try the preview mode or start the process I still get the "The Field contains a calculation error". Length and Width are set to 0 but there is no value of 0 within Sq Feet.

 

=MULT(INDEX(Cuts_and_Trenches.Length,ROW()), 
 INDEX(Cuts_and_Trenches.Width,ROW()))

LF Field Types.jpg
Calculation Error Msg.jpg
0 0
SELECTED ANSWER
replied on February 4, 2022

Now double check the variable names.  If you change field types its going to create new variables names.

 

My variable names are not the same as yours but here it is working with the formula

 

=MULT(INDEX(Table_1.Length,ROW()),INDEX(Table_1.Width,ROW()))

 

1 0
replied on February 7, 2022

Thank you so much, everything is working now!

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

Sign in to reply to this post.