LinqToExcel组和总和 [英] LinqToExcel group and sum

查看:77
本文介绍了LinqToExcel组和总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆