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

Question

Question

Forms Collection Calculation Problem

asked on June 17

Hi,

I'm using Laserfiche 12 Forms on a on premise server.

I'm struggling with getting a formula to work for a collection in the form.  I chose to use a collection rather than table mainly because of the appearance.  The formula is fairly simple, so I thought...quantity times unit price equals total price.   I tried to get A.I. to help with the formula but got spinning in circles so I'm coming to the real experts.  Thanks in advance if you can help point me in the right direction.  

 

Calculation Formula for “Item_Total_Price_1”

=PRODUCT(Item_Information_Collection.Item_Quantity_1,Item_Information_Collection.Item_Unit_Price_1)

 

The Problem

 

The formula works for 1 item in the collection.  If I add a second item, it seems to multiple everything in all the rows.  In this example, I’d like row 1 total to be 2 x $22 = $44, row 2 to be 3 x $11 = $33

 

Variable Info

0 0

Answer

SELECTED ANSWER
replied on June 17

You need to make use of the INDEX() formula and ROW() formula.  The INDEX() formula allows you to target specific fields within a list of values (in this case, the collection) by entering specific column and row values - the column is the actual variable and the row is the same row your calculation is being done.  The ROW() formula is used for targeting the same row of the current field.

The formula should be something like this: 

=PRODUCT(INDEX(Item_Information_Collection.Item_Quantity_1,ROW()),INDEX(Item_Information_Collection.Item_Unit_Price_1,ROW()))

 

2 0
replied on June 17

Thanks Matthew!  That worked.

1 0
replied on June 17

Happy to help!

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.