longncsu Posted September 17, 2002 Posted September 17, 2002 I have this list of names that I want to run a calculation on. Basically I want to start with the first name, preform a script, which will return a result, and insert the result in the name's record. I have thought of some ideas but there's got to be an easier way. Any suggestions?
LiveOak Posted September 17, 2002 Posted September 17, 2002 We probably need a little more detail, but this can be done with a SetField and a looping script or a Replace with a calculation. -bd
longncsu Posted September 17, 2002 Author Posted September 17, 2002 More detail... I have a database called Name, it has a bunch of names. I have another db called Basic, it has a bunch of info related to the Name db. What my script does: It takes a name from the Name db and does a find on how many times it shows up in a specific field in the Basic db, then it gets a percentage of that number, and finally inserts it back into the persons record in the Name db. What I want to do is automatically do all the names in the list without manually selecting each name and running the script.
rdhaden Posted September 17, 2002 Posted September 17, 2002 With a relationship NameToBasic and a relationship AllRecords(make a calculation field in each that's a constant, i.e. cOne = 1, then for the AllRecords relationship match cOne to cOne so that all records match the relationship) Percentage = (Count(NameToBasic::Name) / Count(AllRecords::cOne)) * 100
longncsu Posted September 19, 2002 Author Posted September 19, 2002 Thanks, that solves a lot of others problems. But what happens if you want to subtract from the (Count(NameToBasic::Name). I want to take out anyone that is > $1000 and State = NC from the total. And the money is in another database as well.
CobaltSky Posted September 19, 2002 Posted September 19, 2002 Probably the best way to take out certain records selectively, is to create a lookup field (called "Amount") in your Basic db to bring the money amount into the Basic db, then create a stored and indexed calc field in the Basic db which has a formula along the lines of: Case(Amount > 1000 and State = NC, "", Name) Then, from within your Name db, re-define the NameToBasic relationship to match to the new calculating field in the Basic db. That's it, now your summary and the resulting percentage will exclude the records that meet your criteria.
Recommended Posts
This topic is 8105 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