LinqToExcel组和总和 [英] LinqToExcel group and sum
问题描述
我的Excel下面有行和列,
ABC
1名称类型值
2 x1 a 2
3 x2 b 1
4 x3 a 1
5 x2 b 2
6 x2 b 1
7 x1 a 6我想组合类型并总结价值和FYI:我想达到以下结果
名称x1 x2 x3
类型
a 8 0 1
b 0 4 0
同样的问题:http://stackoverflow.com/questions/26091458/group-by-and-sum-with-linqtoexcel [ ^ ]
< blockquote>我强烈建议您下载本教程: 101 LINQ样本 [ ^ ]并阅读这篇文章:使用LINQ查询表在Excel 2007中 [ ^ ]然后你就可以创建合适的linq语句了。试试!块引用>
I have an Excel with below rows and columns,
A B C
1 Name Type Value
2 x1 a 2
3 x2 b 1
4 x3 a 1
5 x2 b 2
6 x2 b 1
7 x1 a 6and I want to group "type" and sum the "value" and FYI : I wanted to achieve below results
Name x1 x2 x3
Type
a 8 0 1
b 0 4 0
Same Question :http://stackoverflow.com/questions/26091458/group-by-and-sum-with-linqtoexcel[^]
I strongly recommend you to download this tutorial: 101 LINQ Samples[^] and read this article: Using LINQ to Query Tables in Excel 2007[^] then you'll be able to create proper linq statement. Try!
这篇关于LinqToExcel组和总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!