I have 3 dropdown menus, in those 4 fields I have choices to query a SharePoint 2010 list using SPServices
Dropdown filters are: Year, Month, Company List fields are: Year, Month, Company, Department
What I want is to filter the retrieved items based on the values of that 4 dropdowns and then with the result sum all values in the field Department
$().SPServices({
operation: "GetListItems",
async: false,
listName: "List guid",
viewName: "View guid",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /><FieldRef Name='Department' /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var liHtml =$(this).attr("ows_Title");
var Department=$(this).attr("ows_Department");
}
});
How can I only retrieve the filter items and sum the values of that field, CAMLQuery ?