September 17, 200223 yr 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?
September 17, 200223 yr 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
September 17, 200223 yr Author 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.
September 17, 200223 yr 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
September 19, 200223 yr Author 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.
September 19, 200223 yr 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.
Create an account or sign in to comment