Jump to content

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

Recommended Posts

Posted

Ok, the records in my database have a zip code field, and I wanted a field that would tell me how many records in the database have that same zip code. So i set up a self relationship, based on the zip code, and used this calculation:

Count( zip code count::constant )

constant being a field that is always equal to "1".

now my question is this; how can I make it so that it calculates only using the current found set? confused.gif

Posted

Why not use summary fields?

If this were for a printout, I'd use a columnar report with a Sub-Summary by Zip Code part, then insert the Zip Code field and a Count of RecordID summary field on that part to see the count by Zip Code. If this were for view/entry screens, I'd use a calc=GetSummary(Count of RecordID, Zip Code) field to show the count by the current record's Zip Code.

Posted

ok, so i changed my count to a summary field, and then tried to make a calc field using GetSummary, but i can't get it to work.

i have 1 field called "zip code summary" it is a summary field that is a count of the zip code field.

then I have a calc field that is; GetSummary( zip code summary, zip)

and its not for a print out, thats why i didn't think of summary fields, i have only ever used them on printouts.

Posted

I forgot that this method will require you to sort the found set by Zip Code for the summaries to evaluate. Will this work for you?

Posted

how can I make it so that it calculates only using the current found set? confused.gif

Also depends if you want to calculate :

- how many records in the Foundset have a duplicate in the Foundset

- how many records in the Foundset have a duplicate in the whole File

For 2 :

You may use a technique to capture the foundset in a multiline global, then relate this multiline to the ID and match all duplicates through a calculation

cDupe : Serial = SjFoundset::serial, which result will return 1.

You can find more about this technique by doing a find on the script step basically used for it, that it "Copy All Records".

This topic is 7385 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.