过滤旋转的数据表 [英] Filter pivoted datatable
本文介绍了过滤旋转的数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Visual Studio 2008(桌面版)中使用C#我想转换数据表,如下所示。我从以下网站获得了转发代码:简化数据表简化 [ ^ ]
这就是它是什么
Using C# for visual studio 2008 (desktop) I'd like to convert a datatable as shown below. I got the pivoting code from: Pivoting DataTable Simplified[^]
This is what it is
Code Period Vendor Numeric FileDate 20100804 20101201 20110604
USCPIAP 2010 ABN AMRO 2010 01/06/2011 -
USCPIAP 2010 ABN AMRO 2010 01/12/2010 1.6
USCPIAP 2010 ABN AMRO 2010 04/08/2010 1.5
USCPIAP 2011 ABN AMRO 2011 01/06/2011 3.0
USCPIAP 2011 ABN AMRO 2011 01/12/2010 1.6
USCPIAP 2011 ABN AMRO 2011 04/08/2010 1.6
USCPIAP 2012 ABN AMRO 2012 01/06/2011 2.1
USCPIAP 2012 ABN AMRO 2012 01/12/2010 -
这应该是什么
This is what should be
Code Period Vendor Numeric FileDate 20100804 20101201 20110604
USCPIAP 2010 ABN AMRO 2010 01/06/2011 1.5 1.6 -
USCPIAP 2011 ABN AMRO 2011 01/06/2011 1.6 1.6 3.0
USCPIAP 2012 ABN AMRO 2012 01/06/2011 - 2.1
推荐答案
您是否阅读过关于代码转换的CodeProject文章?
您可以找到它 ^ ]。
Have you read my Article on CodeProject about pivotting?
You can find it here[^].
我找到了答案。一旦我为枢轴创建了数字版本的申请,我就应该删除申请栏。
I found the answer. Once I'd created a numeric version of the filedate for the pivot I should have removed the filedate column.
这篇关于过滤旋转的数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文