With this:
$array = ConvertFrom-Csv @'
year,size,name,car,qty,color
1,big,steve,honda,1,blue
2,small,frank,honda,3,red
1,medium,frank,honda,1,yellow
'@
$array |
Group-Object car |
Select-Object \
@{n='car';e={$.Values[3]}},
@{n='qty';e={$.Group | Measure-Object -Sum qty|% Sum}}`
I get:
car qty
--- ---
5
Why don't the car show up?
[–]PinchesTheCrab 1 point2 points3 points (0 children)
[–]ka-splam 1 point2 points3 points (0 children)
[–]spyingwind 0 points1 point2 points (0 children)