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

Question

Question

Laserfiche Forms - Calculation shows invalid variable

asked on November 1, 2023

Hello, 

 

I am trying to get a total for two entries in a table in a Laserfiche form. However, when I am previewing the form and am trying out the calculation it states "This field contains a calculation error. References: Quantity, Unit Price." (Quantity and unit price are the variables i am trying to multiple.) I have attached some pictures for reference. 

Calculation.JPG
Error Message.JPG
Quantity.JPG
Unit Price.JPG
Calculation.JPG (26.14 KB)
Quantity.JPG (18.16 KB)
Unit Price.JPG (19.38 KB)
0 0

Answer

SELECTED ANSWER
replied on November 1, 2023

You need to include the INDEX function for it to work as I believe you intend.

Table.Quantity references ALL values of that column, meaning it is a set of values not a single value, but your calculation seems to be designed to multiply the quantity and unit price for a single row.

The INDEX function allows you to reference a specific value from that set of values, and you can use the ROW() function within a table or collection to reference the "current" row.

As a result, your calculation should be as follows:

=MULT(INDEX(Table.Quantity,ROW()),INDEX(Table.Unit_Price,ROW()))

This calculation would multiply the quantity and unit prices only from the same row as the field containing the calculation.

1 0
replied on November 1, 2023

IT WORKED!!

 

Thank you for your help Jason.

0 0

Replies

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

Sign in to reply to this post.