测量的MDX查询列名称

时间:2014-09-23 19:40:57

标签: ssas mdx olap-cube

有以下查询

select  
    non empty  
    (      
    [Dimension1].[Description].children,  
    [Dimension1].[GCode].members,  
    [Measures].[GScore Sum]   
    )  
    on columns,  
    non empty
    (
    [Dimension2].[DCode].[DCode] *  
    [Dimension2].[DName].[DName] *   
    [Dimension2.[Barcode].[Barcode] *  
    [Dimension2].[LN].[LName] *  
    [Dimension2].[FN].[FName]   

)
on rows
from 
[MCube]
where 
(

{[Dimension2].[HARC].[DCode].&[0000]}

)  

在结果[GSCORE SUM]列名重复是避免重复列名或为每个GLCE代码成员提供唯一名称的方法,而不仅仅是在结果中重复[GSCore Sum]或制作[Gscore Sum]看不见的

http://i.stack.imgur.com/yte59.jpg

1 个答案:

答案 0 :(得分:0)

不是100%确定您需要什么但是您是否尝试将该度量添加到WHERE子句中?:

select  
    non empty  
    (      
    [Dimension1].[Description].children,  
    [Dimension1].[GCode].members 
    )  
    on columns,  
    non empty
    (
    [Dimension2].[DCode].[DCode] *  
    [Dimension2].[DName].[DName] *   
    [Dimension2.[Barcode].[Barcode] *  
    [Dimension2].[LN].[LName] *  
    [Dimension2].[FN].[FName]   

)
on rows
from 
[MCube]
where 
(
[Measures].[GScore Sum],  
{[Dimension2].[HARC].[DCode].&[0000]}
)