WHW Posted March 5, 2003 Posted March 5, 2003 Greetings, I'll try to make this as simple as possible. I'm just now breaking into working with loops, or at least realizing that I could use one here. I would like to loop through a set of records to determine the total qty. of 4 different size binders from one field <binder size> among dozens of clients--each client represents a separate record. (i.e. Client A would have 1 2.5" binder; Client B would have 2 1" binders). I plan on sorting by <consultant>, for one consultant has many clients. I think that I should have 4 global fields, 1 for each of the 4 sizes. These fields should be used to paste the result of the loop calc, right? Basically, what would be the best way to do this? Anything would be great!! What would be the simplest way to do this? Thanks, Jon
Chuck Posted March 5, 2003 Posted March 5, 2003 First of all, yes, you can do this with a loop. I'm going to make some assumptions about how your database is constructed because I'm not entirely sure of the details given your post. First of all, since you say that each record is a client, and a client could need multiples of any particular binder size ("Client B would have 2 1" binders"), I'm assuming that you have four number fields that track the number of binders each client needs of each size. I'll call these fields, SizeCount1, SizeCount2, SizeCount3 and SizeCount4. Create four global number fields. I'll call them gSizeCount1, gSizeCount2, etc. Once you have the found set of records, you can use the following script. Set Field ["gSizeCount1", "0"] Set Field ["gSizeCount2", "0"] Set Field ["gSizeCount3", "0"] Set Field ["gSizeCount4", "0"] Go to Record/Request/Page [First] Loop
WHW Posted March 5, 2003 Author Posted March 5, 2003 Thanks for the reply. I currently have one field labeled "Binder Size" that contains, per client, one of 4 different values. I imported this info direct from Excel and had thought that creating 4 different size fields would be better, but wanted to take a stab at this first. Can I still loop a set of records and pull the different values from one field and place them into the appropriate global fields, i.e. the 4 gSizeCount fields??
Chuck Posted March 7, 2003 Posted March 7, 2003 Yes, you can, and there are a number of ways. I'll cover the scripting way. Just edit the script I originally gave you to look like this. I've assumed a single field called Size which holds one of four possible values. Set Field ["gSizeCount1", "0"] Set Field ["gSizeCount2", "0"] Set Field ["gSizeCount3", "0"] Set Field ["gSizeCount4", "0"] Go to Record/Request/Page [First] Loop
Recommended Posts
This topic is 7936 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