Star-crossed

Using LINQ to get roll-up data

Sep 25th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1.                         var groups = from SPListItem item in licMktDocs
  2.                                      orderby item["Modified"] descending
  3.                                      group item by item["Title"] into itemgroup
  4.                                      select new { Title = itemgroup.Key, Completion = itemgroup.Count(i => i["Completion"] == "completed") / itemgroup.Count() * 100, Date = itemgroup.First()["Date"]};
Advertisement
Add Comment
Please, Sign In to add comment