Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8105 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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.

Posted

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

Posted

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.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.