I'm trying to add a script that will loop through the found records and total the value of the fields.
I've tried using the Insert Calculated result using the caclulation "field 1 total = field 1 total + field 1" to increment the count but it doesn't add the "field 1" value to it.
Any ideas on how best to do this?
The fp5 database contains inventory info. The script needs to tally usage for each inventory item for the month.
I plan to first search and find all records for that month and then extract the quantity of each item used in that period.
There are 24 unique items in the inventory and they don't have unique field names. Any of the 24 products can (and are) entered in any of one of the six Quantity-product groups. The fields in the database are in 6 groups of Product qty and product name:
Quantity1 Product1
Quantity2 Product2
Quantity3 Product3
Quantity4 Product4
Quantity5 Product5
Quantity6 Product6
The script I thought would work would find all the records for the month and use if-then loops to check the field "Product1" to see if it's a widget and if it is then copy the value in the corresponding quantity1 field and put it in a widget total field then go to the next found record, see if "Product1" also contains "widget" and if it does then copy that "quantity1" value and add it in a total field. The Insert calculated result doesn't add the second record's quantity1 value to the total though.
Does my total field need to a certain field type? I tried using a summary field but it only seems to be designed to add field values.
It seems simple but I'm at a loss as to how to do it. Any help or hints would be most appreaciated.
Thanks,
Curt
I've tried using the Insert Calculated result using the caclulation "field 1 total = field 1 total + field 1" to increment the count but it doesn't add the "field 1" value to it.
Any ideas on how best to do this?
The fp5 database contains inventory info. The script needs to tally usage for each inventory item for the month.
I plan to first search and find all records for that month and then extract the quantity of each item used in that period.
There are 24 unique items in the inventory and they don't have unique field names. Any of the 24 products can (and are) entered in any of one of the six Quantity-product groups. The fields in the database are in 6 groups of Product qty and product name:
Quantity1 Product1
Quantity2 Product2
Quantity3 Product3
Quantity4 Product4
Quantity5 Product5
Quantity6 Product6
The script I thought would work would find all the records for the month and use if-then loops to check the field "Product1" to see if it's a widget and if it is then copy the value in the corresponding quantity1 field and put it in a widget total field then go to the next found record, see if "Product1" also contains "widget" and if it does then copy that "quantity1" value and add it in a total field. The Insert calculated result doesn't add the second record's quantity1 value to the total though.
Does my total field need to a certain field type? I tried using a summary field but it only seems to be designed to add field values.
It seems simple but I'm at a loss as to how to do it. Any help or hints would be most appreaciated.
Thanks,
Curt