简体   繁体   English

按连接到SSAS OLAP多维数据集的Excel中的键排序

[英]Sort by key in Excel connected to SSAS OLAP cube

I searched the Internet and StackOverflow and was not able to find an answer to this issue. 我搜索了Internet和StackOverflow,但无法找到这个问题的答案。 I created an OLAP cube via SSAS with a date dimension. 我通过带有日期维度的SSAS创建了一个OLAP多维数据集。 One of the attributes of the dimension is Activity Calendar Month . 维度的一个属性是活动日历月 The NameColumn value is formatted like "January 2015", "February 2015", etc. NameColumn值的格式为“2015年1月”,“2015年2月”等。

The KeyColumns is set as a DATE value type for the first of the month, for each month. KeyColumns设置为每个月的第一个月的DATE值类型。 Example, NameColumn value "January 2015" = KeyColumns value "1/1/2015", "February 2015" = "2/1/2015", etc. 示例, NameColumn值“2015年1月”= KeyColumns值“1/1/2015”,“2015年2月”=“2015年2月1日”等。

The ValueColumn is also set to first of the month date (ie '1/1/2015') in case Excel was using that for sorting. ValueColumn也设置为月份日期的第一天(即“1/1/2015”),以防Excel使用它进行排序。

When I view the Calendar Month dimension in an Excel 2013 workbook, it initially loads with the correct sorting. 当我在Excel 2013工作簿中查看日历月维度时,它最初加载正确的排序。 Below is a sample: 以下是一个示例:

January 2015
February 2015
March 2015
April 2015
May 2015
June 2015
July 2015
August 2015
September 2015

However, I want to be able to right-click on the field in Excel and select Sort > Sort Z to A and sort the months descending. 但是,我希望能够在Excel中右键单击该字段并选择“ 排序”>“将Z排序为A”并对月份进行排序。 When I currently do this, I get back: 当我这样做时,我回来了:

September 2015
May 2015
March 2015
June 2015
July 2015
January 2015
February 2015
August 2015
April 2015

To me, it appears the Excel will only sort based on the alphanumeric value set in the dimension's NameColumn . 对我来说,Excel似乎只会根据维度的NameColumn设置的字母数字值进行排序。 Also, if I drop the years from the month values (ie "January" instead of "January 2015"), Excel seems to understand that it is a month and sorts the months correctly. 此外,如果我从月份值(即“1月”而不是“2015年1月”)中删除年份,Excel似乎明白它是一个月并正确地对月份进行排序。

Screen Shot of Dimension Settings 尺寸设置的屏幕截图

活动日历月属性

Questions 问题

  • Does Excel have the capability to sort on values outside of NameColumn , such as KeyColumns or ValueColumn , where the NameColumn does not use standard month names (ie "January", "February", etc.)? Excel是否能够对NameColumn之外的值进行排序,例如KeyColumnsValueColumn其中 NameColumn不使用标准月份名称(即“January”,“February”等)?

  • If yes, then what might I be missing in the SSAS dimension setup to make this work? 如果是,那么在SSAS维度设置中我可能会缺少什么来使其工作?

Can you read the last paragraph here: https://olappivottableextend.codeplex.com/wikipage?title=Show%20Property%20as%20Caption&referringTitle=Home 你能在这里阅读最后一段: https//olappivottableextend.codeplex.com/wikipage?title = Show%20Property%20as%20Caption&referringTitle = Home

One advantage of the built-in "Show Properties In Report" feature is that the member properties come through into Excel with their proper datatypes. 内置的“在报表中显示属性”功能的一个优点是成员属性以其正确的数据类型进入Excel。 So a member property of datetime datatype comes across as such and can be formatted using Excel formatting. 因此,datetime数据类型的成员属性就是这样,并且可以使用Excel格式进行格式化。 And numeric member properties come across as such and can be formatted in Excel. 数字成员属性也是如此,可以在Excel中格式化。 However, when you use any member property as a caption using the "Show Property as Caption" OLAP PivotTable Extensions feature, the caption comes across as a string and cannot be formatted in Excel, unfortunately. 但是,当您使用任何成员属性作为标题使用“显示属性作为标题”OLAP数据透视表扩展功能时,标题会出现一个字符串,不幸的是无法在Excel中格式化。

It talks about formatting in Excel but I believe sorting in Excel applies too. 它讨论了Excel中的格式,但我相信Excel中的排序也适用。

So... Add a new member property of your Activity Calendar Month attribute with the same date key (first of the month) then add that member property to the PivotTable and try to sort by it. 所以...使用相同的日期键(当月的第一个)添加Activity Calendar Month属性的新成员属性,然后将该成员属性添加到数据透视表并尝试按它排序。 If you can, great. 如果可以,那很好。 If not then install that OLAP PivotTable Extensions add-in and use Show Property As Caption then sort. 如果没有,则安装该OLAP数据透视表扩展加载项并使用显示属性作为标题然后排序。 Make sense? 说得通?

PS Thanks for the very well written question! PS感谢写得很好的问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM