Jump to content

Count subgroups on simple-sort, flat-file


 Share

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

Recommended Posts

I have* a flat file, tracking sales, with fields like Date, State, Salesperson, Item, etc. I frequently find myself doing a search on some single criterion (e.g. all sales by a particular salesperson), and sorting on a second criterion, e.g. State (by viewing in Table view and just clicking on the column header).

What I want to do is add a summary function that tells me how many "groups" are produced as a result of the Sort.

So, for example, if I sort by State, I want to know: how many unique States are in this sorted found set? If I sort by Date, I want to know: how many unique Dates are in this sorted found set? etc.

I found an old discussion (about a year old) on the forum that solves this problem partially: it involves defining a summary Count function, then a calculation that inverts the count, then another summary function that totals the inverses of the counts. Whew! It works just fine, but it's particular to counting unique occurrences in a specific field. I want a solution more generic than this.

It seems odd to me that FMP can generate reports with subgroups and subsumarries, and can tell me how many records are in each subgroup, but can't (easily) tell me how many subgroups there are. Doesn't this seem like a natural thing to count?

* Actually, I don't have this at all. What I have is way more complicated than this, and doesn't involve sales of any sort. But this is an abstract version of what I want to do.

Link to comment
Share on other sites

This topic is 5696 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
 Share

×
×
  • Create New...

Important Information

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