Newbies craigers521 Posted May 16, 2011 Newbies Posted May 16, 2011 I am trying to figure out a way to create a script to loop through specific fields, but i can't use variables in field names. I have a table that contains inventory information for a walk-in cooler, each footprint in the cooler has fields for type of product and qty. They are all named the same except for the number after the end of each field name ex prod1, prod2, prod3, qty1, qty2, qty3 etc etc. I was writing a script to populate another table in the database with sums of everything in the walkin (ie 15 of this type, 30 of this type, etc) I thought i could set up something like a for loop where i have an integer that increments at the end of each loop iteration so i could use the value of the integer in the variable (ex. prod$i, qty$i.) Filemaker will not let me do this however because it wants a specific field name. I thought about using the "go to next field" function but each walkin object has multiple fields, and I'm not sure how to tell which field I am on or how to pass the value of the "current field" to a local variable. This walk-in is huge and it would take me forever to do each individual field. Any ideas on how i can loop through these fields to pull the information i want?
comment Posted May 16, 2011 Posted May 16, 2011 I believe you would find it much more convenient to have a record for each ... what is it, a "footprint"?
bruceR Posted May 17, 2011 Posted May 17, 2011 I am trying to figure out a way to create a script to loop through specific fields, but i can't use variables in field names. I have a table that contains inventory information for a walk-in cooler, each footprint in the cooler has fields for type of product and qty. They are all named the same except for the number after the end of each field name ex prod1, prod2, prod3, qty1, qty2, qty3 etc etc. You are trying to solve the wrong problem. Field names like that are almost always always a sign that the basic data structure needs to be normalized. Because - no surprise here- it presents reporting problems, and many other problems. It will help to start with a more complete description of what this is all about.
Recommended Posts
This topic is 4940 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now