在 Excel 中呈现星型架构(二维表)
如果不属于此处,请移至适当的论坛。
我有一个数据源,它表示星型模式中的一些多维数据。 例如 /Products /SalesYear /SalesContact /Region /Salesdata
现在我想在简单的表格视图中呈现此数据
示例
2005 2006 2007 Product1 Category1 27m$ 30m$ 35m$ Category2 9m$ 1m$ 11m$ Product2 Category1 27m$ 30m$ 35m$ Category2 9m$ 1m$ 11m$
是否有任何标准算法或技术可用于显示此类数据?
[编辑]
我本质上需要的是一种有效的方法来构建内存中的多维数据集,就像 powerpivot 所做的那样,但规模较小。
Please move to an appropriate forum if it doesn't belong here.
I've a data feed that represents some multidimensional data in star schema.
e.g. /Products /SalesYear /SalesContact /Region /Salesdata
Now I want to render this data in a simple tabular view
example
2005 2006 2007 Product1 Category1 27m$ 30m$ 35m$ Category2 9m$ 1m$ 11m$ Product2 Category1 27m$ 30m$ 35m$ Category2 9m$ 1m$ 11m$
Are there any standard algorithm or techniques that can be used to display this kind of data?
[EDIT]
What I need essentially is an efficient method to build an in-memory cube like powerpivot does but at a smaller scale.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你可以使用@Dick Kusleika的这个答案的修改版本: 在 Excel 2007 中将包含数据列的行转换为包含多行的列。请注意,此解决方案没有上面的 Product1/Product2 下的嵌套行,但我的猜测是您可以很容易地修改该解决方案以处理两个行标题:列
A
将包含产品名称和列B
将包含类别。编辑:我误解了,认为您试图获取该格式的数据,而不是该格式的数据。
如果您有 Excel 2010,则 PowerPivot 插件 可以直接使用 OData 字段(在 OData.org 消费者页面 如果您使用的是较旧的 Excel,您仍然可以使用 < 提取数据。 code>从 Web 获取外部数据。您可能需要在中间插入一个代理页面(ASP.NET、PHP,无论您喜欢什么),以理解 JSON 并将其转换为 HTML 表。 >从 Web 获取外部数据 肯定会了解如何从标准表中读取数据。
一旦您在 Excel 中的规范化工作表中获得了数据,只需插入使用该范围的数据透视表即可。它是数据源。
I think you could use a modified version of this answer by @Dick Kusleika: Convert row with columns of data into column with multiple rows in Excel 2007. Note that this solution does not the nested rows under Product1/Product2 that you have above, but my guess is you could pretty easily modify the solution to handle two row headings: column
A
would contain product name and columnB
would contain the category.EDIT: I misunderstood and thought you were trying to get the data out of that format, not in to that format.
If you have Excel 2010, the PowerPivot plugin can consume OData fields directly (found the answer on the OData.org consumers page. If you have an older Excel, you might still be able to pull the data in with
Get External Data From Web
. You may need to throw a proxy page (ASP.NET, PHP, whatever you're comfortable with) in-between that understands JSON and transform it into an HTML table.Get External Data From Web
will definitely understand how to read data from a standard table.Once you have the data in a normalized sheet in Excel, it should only be a matter of inserting a Pivot Table that uses that range as it's data source.