![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
I am attempting to do some counting. I am able to get a count of what I need a count of, however it is a grand total. I am using summary fields which I have created, to count the number of fields which appear. However I am attempting to get it to do this, and count number of instances. An example is that say I have various things. These things are red, blue, and green. I want a count orf the total number of things, and the number of red, number of blue, and number of green. While all of these things still fall under the things field. Thanks, Matt |
#4
| |||
| |||
|
|
In article <1173251791.510542.5340 (AT) 8g2000cwh (DOT) googlegroups.com>, "mattG" <mgohring (AT) gmail (DOT) com> wrote: I am attempting to do some counting. I am able to get a count of what I need a count of, however it is a grand total. I am using summary fields which I have created, to count the number of fields which appear. However I am attempting to get it to do this, and count number of instances. An example is that say I have various things. These things are red, blue, and green. I want a count orf the total number of things, and the number of red, number of blue, and number of green. While all of these things still fall under the things field. Thanks, Matt Several ways of doing this. The simplest is to define a summary field Count(Item) where Item is a field that is always filled in the record. Then put a subsummary part in a suitable layout, with the subsummary set to work when sorted by x, where x is the field that contains the attribute you want to count -- color in the example you give. Then sort the records by that attribute, and switch to the preview mode. Subsummaries do not show up in the Browse mode, only in the Preview mode or in the printed document. You can also use the GetSummary function in a calculation. Another way is by means of relationships, with several relationships each based on a different color. In the master table define a calculation field Count(Red::Item), where Red is the related table occurrence based on the relationship to red, and so on for the other colors. The Master table would contain a global field that holds the word "Red" with the relationship defined as: Master::GlobalWordRed = Related::Color with similar global fields and relationships for the other colors. Another way, that also depends on a relationship, is to define calc fields with If statements, thus: Red = if(Color = "Red";"x";""), then define a calc field in a master table thus: CountRed = Related::Count(Red) |
|
Still another is to do a series of scripted Finds, one for each Color, and count how many records in each found set. |
![]() |
| Thread Tools | |
| Display Modes | |
| |