Hi,
I have a repeating table on a form linked to a database. The values in the table are filled in from a query button, which searches a database populated by a different form. One of these columns is named 'Ammortised Tooling'. The default value for the rows in this column come from the database, but the value needs to be updated (it needs to be divided by a number) after another field in the form is entered.
Basically, if the value of another field is above a certain nnumber thevalues in the column need to be divided by that number. If the value in the other field is below a certain value it needs to be divided by a set number. For example, say the value in the repeating table is 100. The value in the other field, Contract Duration, is 10. I need ALL the values in the repeating table to be divided by 10, if it is 9 then by 9, if it is 8 then by 8 etc. If the value in the Contract Duration is below 5 or below, then i need all the values to be divided by 5.
i don't know how to set the default value in the repeating table to be dependent on different conditions, so i set a rule on the field outside of the repeating table, the Contract Duration field. If the value was above 5, i set it to divide by that number and if below 5 then i set it to divide by 5. the trouble is that when i enter a number, all the values in the repeating field show the calculation for the first row in the table. For example if there are three rows in the table and the values for that column are 10, 20, 30. Using my rules after dividing by 5 then the new values in the columns should be 2, 4, 6. But in fact they all come back 2, 2, 2.
Obviously it is returning the value for the first row in all of the rows below. So i am wondering if there are other conditions or filters i need to add to my rules. Or, ideally, if there is a formula i can set in the default value for my field in the repeating table?