There has to be an easy way to do this

I’ve constructed a view to display the number of items in a given category. As an example (Note I used … as spaces to preserve the formatting in the forum):

FAMILY COUNT SUBFAMILY

0003…2

…0003.1

…0003.2

0004…1

…0004.1

0005…1

…0005.3

Where the value of COUNT is defined as a formula with an entry of 1 (a well known trick for counting things in views). This part works perfectly, but the problem is that I only want the view to display the rows with counts greater than or equal to 2 in the view. Is there a simple way to do this? I’ve search the forums and all resources with no success.

So basically I want the output from the above example to look like this:

FAMILY COUNT SUBFAMILY

0003…2

…0003.1

…0003.2

with the remaining rows dropped from the above example.

Anyone got any ideas on this. If it has been posted to the forum elsewhere send me the search string to find it. Thanks in advance :slight_smile:

Subject: If there is no easy way to do this then what?

Anyone have any ideas on how to do this in a non-simple fashion?

Subject: RE: If there is no easy way to do this then what?

As I said, you need to make changes to the documents themselves. You cannot make selection decisions based on anything external to the documents themselves.

Whenever a document is saved or deleted, make it look for “relatives” (GetAllDocumentsByKey in a not-count-restricted view) and count them (don’t forget to add one if it’s a new document or subtract one if you’re deleting). If the colloection count meets your “critical minimum”, then set a field value on the documents to include them in your count-restricted view. If you cn stand some delay in processing, then use a scheduled agent rather than event-driven code to do pretty much the same thing.

Subject: Or skip the view and use an agent

Actually, the view would still exist, but you could simply walk the view using the NotesViewNavigator and only include thos categories you chose, based on any criteria.

Subject: There has to be an easy way to do this

You just want to be able to look at this information, right? Then write an agent to create a rich text facsimile of the view, save the result as a document, and display the document instead of the view.

Subject: There has to be an easy way to do this

Sorry – there doesn’t actually have to be an easy way, so there isn’t. The thing is that the count doesn’t exist until after the documents are indexed into the view, so you can’t base view selection on it. You would need to make a change to the documents themselves in order to affect selection/display.