Jump to content

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

Recommended Posts

Posted

Hi all,

it's the newbie again.

I would like to count (and record) the total number of records in the file, so that I can use that number to do calculations with. Is this a calculation? A global field? A summary?

Can anyone give me a pointer?

Posted

Hi Ano,

Status(CurrentRecordCount) will always return the total number of records in a file. Status(CurrentFoundCount) will always return the total number of records in a found set (or all records if no found set is returned).

And record it? It depends upon what you want to do and what types of calculations you want. These functions update automatically for you. What types of calcs are you considering?

For instance, it's possible to use script and Set Field [global, Status(CurrentFoundCount)] to use for other things, but it's usually not necessary because these functions would always be available for you. Let us know what you're planning and we might be able to give you some ideas. smile.gif

LaRetta

Posted

Thanks smile.gif

I wanted to count the number of records with a certain value (let's say the number of male persons in the db), divide that by the total number of records, multiply by 100 et voila: I have a percentage of records with a certain value.

Or are there more elegant ways of going about this?

Posted

You don't have to multiply by 100...you could format the resulting calculation to display as a percentage by selecting the field in layout mode then choosing Number under the Format menu. Other than that minor tweak (and your way works fine, especially if you want to use the calculation later in other calculations), you're right right on the money.

Posted

A little feedback: when I create a calculation field Status(CurrentFoundCount), it shows the number of records before and including the record I am currently in. So the field shows '1' when I am in the first record. Then I browse to the second record and it shows '2'.

I went and created a summary field that does a count of the first field I created. That field now shows the total number of records present in the file o/ smile.gif

Posted

Hi Ano,

Well I'm happy to hear that your happy! smile.gif

I thought, however, that you needed to know the percentage of males, for instance. And isolating the percentage of different contents within one field based upon the total records in the file would take a bit more. If you always want a calc displayed on a layout

Posted

Wow, thanks for the extra info, I'm sure that'll come in very handy, if not for the mess I'm creating right now, then for another one I'll make some day. Not to mention that it is an insight for me into how experts solve this sort of thing, contrary to my own self-wrought abominations laugh.gif I am happy with every look inside your heads I can get smile.gif

Posted

LaRetta said:

Hmmm, well Status(CurrentFoundCount) shows the total records (if all records are showing) without the need to summarize them. I'm unsure what 'field' you summarized but Status(CurrentRecordCount) always returns the total records in a file. Are there only two records? Or only two records being displayed in a found set? Or did you accidently use Status(CurrentRecordNumber)?

Ah yes, you are right, I confuddled Found and Record blush.gif

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