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

Question

Question

Calculations in a Collection

asked on June 11, 2018

I am building an Expense Report, and using Collections for Mileage, Travel, and Miscellaneous, ect... I have a calculation in my Mileage Collect to take the number of miles traveled and multiply by the mileage rate 0.545 to give me the Total Amount of mileage due. (This calculation works) But when I click on ADD to my collection to add a different date and calculate that is divides the calculation in half. And keeps dividing for as many collections I add. So my question is how do I just have a calculation happen for each individual collection?

Expense Report.JPG
0 0

Answer

SELECTED ANSWER
replied on June 11, 2018 Show version history

You need to use the INDEX function to isolate specific instances of a collection.

 

Each Variable needs to be wrapped in an INDEX function with the ROW() function, which tells it to use the value from the current "row" of the Collection

For Example,

INDEX(Collection.V_1,ROW())

 

Then, use that in your calculation instead of just the variable

For Example,

=SUM(INDEX(Collection.V_1,ROW()),INDEX(Collection.V_2,ROW()))

 

The end result would give you what you want; a standalone total for each collection you add

4 0
replied on June 12, 2018

That worked! Thank you!

 

0 0

Replies

replied on June 11, 2018

From what I can see on the picture, it looks like you are building your form using single-line fields rather than a table.  Is that correct? 

0 0
replied on June 12, 2018

Correct!

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

Sign in to reply to this post.