Best way to get list of unique values of a field on all documents

I am struggling to find the best way to approach the following task. I am writing a LS Agent that will process the sales totals by customer through a given time period.

My problem is in figuring the best way to get a list of all unique customer names that can then be stepped through in the Lotus Script Agent.

Every sales order is a separate document that has a field for the customer name and sale total. Initially, I was going to create a categorized view of customer names and step through a document collection of that view. But, the collection will still contain an entry for each order entry – not a unique customer list.

As far as I can tell, the next option is to build an array list from a view to gather all customer names and then use the ArrayUnique function to remove duplicates.

I am wondering if this is the best way, or am I missing a simpler way to do this?

Thank you for any insight.

Subject: Best way to get list of unique values of a field on all documents

Categorised view, Evaluate({@dbColumn(…)}). There ain’t no better, faster way.

Subject: RE: Best way to get list of unique values of a field on all documents

Gotcha’. I will use your sugestion. I have always shied away from using the Evaluate function. Now is the time to start using it.

Thank you for the help.