2

嗨,我有以下 MDX 查询:

select NON EMPTY {[Measures].[count_X]} ON 0,
NON EMPTY {[DIM_DAYS].Children} ON 1 
from [Cube]

使用以下结果集:

Axis #0:
{[DIM_S].[A], [DIM_LOCALIT].[X], [DIM_ANNO].[2013]}
Axis #1:
{[Measures].[count_X]}
Axis #2:
{[DIM_TEMPO_RILASCIO].[#null]}
{[DIM_TEMPO_RILASCIO].[0]}
{[DIM_TEMPO_RILASCIO].[1]}
{[DIM_TEMPO_RILASCIO].[2]}
{[DIM_TEMPO_RILASCIO].[3]}
{[DIM_TEMPO_RILASCIO].[4]}
{[DIM_TEMPO_RILASCIO].[5]}
{[DIM_TEMPO_RILASCIO].[6]}
{[DIM_TEMPO_RILASCIO].[7]}
{[DIM_TEMPO_RILASCIO].[8]}
{[DIM_TEMPO_RILASCIO].[9]}
{[DIM_TEMPO_RILASCIO].[10]}
Row #0: 468
Row #1: 69
Row #2: 70
Row #3: 53
Row #4: 90
Row #5: 77
Row #6: 78
Row #7: 119
Row #8: 159
Row #9: 155

我想: 1) 更改 #null 标签而不指定 2) 将日期范围设为 [1 - 30] [31 - 60]

有人可以帮助我吗?谢谢

4

1 回答 1

2
with Member [DIM_TEMPO_RILASCIO].[NOT SPECIFIED] AS
            [DIM_TEMPO_RILASCIO].[#null]                       // just rename it
     Member [DIM_TEMPO_RILASCIO].[1-30] AS
            Aggregate( [DIM_TEMPO_RILASCIO].[1] : [DIM_TEMPO_RILASCIO].[30] )
     Member [DIM_TEMPO_RILASCIO].[31-60] AS
            Aggregate( [DIM_TEMPO_RILASCIO].[31] : [DIM_TEMPO_RILASCIO].[60] )
select NON EMPTY {[Measures].[count_X]} ON 0,
       NON EMPTY {
           [DIM_TEMPO_RILASCIO].[NOT SPECIFIED],
           [DIM_TEMPO_RILASCIO].[1-30],
           [DIM_TEMPO_RILASCIO].[31-60]
       } ON 1 
  from [Cube]

应该提供您在问题中所说的内容。但是,我不确定你为什么要离开[DIM_TEMPO_RILASCIO].[0]。而且我并不详细了解维度和层次结构名称,但也许您可以将我的解决方案转移到您的实际情况中。

于 2013-07-30T18:21:48.897 回答