Skip to content

Instantly share code, notes, and snippets.

View sql-sith's full-sized avatar

Chris Leonard sql-sith

  • principal domains data architect at godaddy
  • cedar rapids, iowa, usa
  • X @databaseguy
View GitHub Profile
@Kurt-P
Kurt-P / GropuAndSum.ps1
Created August 20, 2013 20:54
Group and sum a set of data with powershell
$gdata = $printsLogs | Group-Object -Property userId
$test = @()
$test += foreach($item in $gdata){
$item.Group | Select -Unique userId,
@{Name = 'PageTotal';Expression = {(($item.Group) | measure -Property pages -sum).Sum}}
}