November 10, 200322 yr 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?
November 10, 200322 yr 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. LaRetta
November 10, 200322 yr Author Thanks 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?
November 10, 200322 yr 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.
November 11, 200322 yr Author 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/
November 11, 200322 yr Hi Ano, Well I'm happy to hear that your happy! 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
November 11, 200322 yr Author 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 I am happy with every look inside your heads I can get
November 11, 200322 yr Author 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
Create an account or sign in to comment