我有一个查询,我想在其最大的一个维度字段中过滤它,如下所示:
SELECT
{
[Measures].[F Sra Quantity],
[Measures].[F Sra Gross],
[Measures].[F Sra Disc TOTAL]
}
DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME
ON COLUMNS,
NON EMPTY
CrossJoin(
{[Branch Dim].[b Name].Children},
{[Date Dim].[d Year Month].Children},
{[Date Dim].[Full Date].Children},
{[Customer Dim].[c Name].Children},
{[Customer Dim].[c Path].Children},
{[Order Specification Dim].[Os Type No].Children},
{[Sales Team Dim].[Id].Children},
{[Sales Team Dim].[St Visitor].Children}
)
ON ROWS
FROM [D Sys Warehouse]
我想在[Os Type No]的最大值上过滤它,其成员总是在变化。你能帮帮我吗?
答案 0 :(得分:0)
我没有接受测试,因为我不在SSAS
或AdvWrks
多维数据集附近,但假设我已正确解释您的请求,这些内容可能会有效:
WITH MEMBER [Measures].[MAX_No] AS
MAX(
[Order Specification Dim].[Os Type No].MEMBERS,
[Order Specification Dim].[Os Type No].CURRENTMEMBER.MEMBER_VALUE
)
SELECT
{
[Measures].[F Sra Quantity],
[Measures].[F Sra Gross],
[Measures].[F Sra Disc TOTAL]
}
DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME
ON COLUMNS,
NON EMPTY
CrossJoin(
{[Branch Dim].[b Name].Children},
{[Date Dim].[d Year Month].Children},
{[Date Dim].[Full Date].Children},
{[Customer Dim].[c Name].Children},
{[Customer Dim].[c Path].Children},
{[Order Specification Dim].[Os Type No].Children},
{[Sales Team Dim].[Id].Children},
{[Sales Team Dim].[St Visitor].Children}
)
HAVING
[Order Specification Dim].[Os Type No].CURRENTMEMBER.MEMBER_VALUE = [Measures].[MAX_No]
ON ROWS
FROM [D Sys Warehouse]