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:
3080+300371+1090210

duplicate
My list has about 80,000+ items with duplicates throughout.
LVL 5
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.

leakim971PluritechnicianCommented:
From Google :

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

http://tipsinsharepoint.wordpress.com/2010/06/24/3-level-cascading-dropdowns-in-sharepoint-remove-duplicate-records/
0
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}
0
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,

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

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

Open in new window

0

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
leakim971PluritechnicianCommented:
nice, close and accept your own answer
0
IsaacSharePoint Client Side DeveloperAuthor Commented:
Found solution on my own.
0
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.