OLAP - 级别具有相同的名称

时间:2011-09-22 13:05:50

标签: mdx olap

我有以下层次结构:

 <Dimension name="Locations">
<Hierarchy hasAll="true" allMemberName="All Locations" primaryKey="loc1Id"  uniqueKeyLevelName="loc1Id">
  <Table name="OLAP_Budget"/>
  <Level name="location1" column="location1" uniqueMembers="true"/>
  <Level name="location2" column="location2" uniqueMembers="true"  hideMemberIf="IfBlankName"/>
  <Level name="location3" column="location3" uniqueMembers="true"  hideMemberIf="IfBlankName"/>
</Hierarchy>

问题:

“location1”是通过不同的会计年度退出,并且在每个会计年度中有不同的子女。 我在列中显示了“fiscalYear”维度,但是当我选择显示特定财务年度的值时,它会显示所有子项的整个财务年度。

我该如何解决这个问题?

先谢谢

1 个答案:

答案 0 :(得分:0)

嗯,SSAS不知道年份和地点之间的关系是什么 - 而且不应该这样。通常情况下,您有一些组合的数据和唯一的方法(除了将年份和位置放在同一维度并构建用户定义的层次结构,我不建议,因为它听起来不对),是编写您的查询与非空。例如:

SELECT
{
    [Measures].[Some Measure]*
    [Date].[Calendar].[Year].&[2011]

} ON 0,
{
    [Location].[Location 1].Members
} ON 1
FROM [Some Cube]

显示行上的所有位置,无论它们是否具有针对它们的数据。但是,如果将其修改为:

SELECT
{
    [Measures].[Some Measure]*
    [Date].[Calendar].[Year].&[2011]

} ON 0,
NON EMPTY {
    [Location].[Location 1].Members
} ON 1
FROM [Some Cube]

然后,您将获得2011年拥有数据的位置。这样您就可以获得所需的结果。