Getting rid of duplicate entries in an array and generating totals

I have an array that has a lot of duplicate entries, is there a function or something in notes like @Unique that can remove duplications?

The overall problem is that I have a view with two columns ‘Reference’ and ‘Cost’. There are multiple reference numbers and I am trying to get the total cost for each reference number.

I figured I would put all the reference numbers into an array, remove duplicates and then make a document collection for each reference and use a running total.

This isn’t particularly efficient and this will be running on a daily basis but I can’t think of any other method.

Another idea I had was to create a column totals but I couldn’t figure out how to access the column totals.

Has anyone got any ideas? Any help would be gratefully received.

Regards,

Katherine

Subject: I would suggest that you read up on the NotesViewNavigator class. It can get to Totals and Categories in the view.

Subject: ArrayUnique will do the 1st bit :wink: (WAS: Getting rid of duplicate entries in an array and generating totals)

Subject: Thanks, that was what I was looking for!

I thought there must be something but couldn’t find anything.

Cheers again,

Katherine