Duplicate values in SP List

Hello All,

I have a list as seen below.  I need to add up the “Projected Amount” column but I don’t want to add up duplicates.  I just need to add the value once for each "Program Name".  When it comes to CAML query, there is no 'DISTINCT' keyword to use to get distinct "Program Name" as in my example.

So, using the example below, I would be adding as follows:

My list has about 80,000+ items with duplicates throughout.
IsaacSharePoint Client Side DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

From Google :

{Link to competing site deleted by COBOLdinosaur, Topic Advisor}

IsaacSharePoint Client Side DeveloperAuthor Commented:
I found those links yesterday.

I found the following solution today and it worked great.

{ Link to competing site removed by COBOLdinosaur, Topic Advisor}
IsaacSharePoint Client Side DeveloperAuthor Commented:
Here's how I solved the issue...
I used function for arrays called _.uniq() found http://underscorejs.org/#uniq

It removes duplicates from an array.
Here's how I coded it,

   arrProjs = _.uniq(arrProjs,true);  //<-- will have unique values
      $.each(arrProjs, function (index, value) {																			
		alert(index + ':' + value);

function getProjects() {
                operation: "GetListItems",
                listName: "Projects",
                async: false,
                CAMLViewFields: "<ViewFields><FieldRef Name='ProjectNumber'></FieldRef></ViewFields>",    
		CAMLQuery: "<Query></Query>",
                completefunc: function (xData, Status) {
                    $(xData.responseXML).SPFilterNode("z:row").each(function () {
                        var projNumber = $(this).attr("ows_ProjectNumber");				

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nice, close and accept your own answer
IsaacSharePoint Client Side DeveloperAuthor Commented:
Found solution on my own.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.