我在行和列上有多个CROSSJOIN的查询我要过滤所有数据[Measures].[Flag] = 1
这是一个例子:
SELECT
{
NonEmpty
(
CrossJoin
(
{
[Time].[2016]
,[Time].[2017]
}
,CrossJoin
(
{
[Quarters].[2 Quarter]
,[Quarters].[1 Quarter]
}
,{
[Measures].[Load]
,[Measures].[Flag]
}
)
)
)
} ON ROWS
,{CrossJoin([Industry].[Industry 1],[Client].[Set 1])} ON COLUMNS
FROM [Cube]
WHERE
[Version].[Actual];
如果我这样做:
SELECT
{
NonEmpty
(
CrossJoin
(
{
[Time].[2016]
,[Time].[2017]
}
,CrossJoin
(
{
[Quarters].[2 Quarter]
,[Quarters].[1 Quarter]
}
,{
[Measures].[Load]
,[Measures].[Flag]
}
)
)
)
} ON ROWS
,{
Filter
(
CrossJoin
(
[Industry].[Industry 1]
,[CLient].[Set 1]
)
,
[Measures].[Flag] = 1
)
} ON COLUMNS
FROM [Cube]
WHERE
[Version].[Actual];
我得到一个空集。在没有过滤器的结果集中,有Flag = 1
答案 0 :(得分:1)
如果您只是将其移动到HAVING子句中有帮助吗?
SELECT
{
NonEmpty
(
CrossJoin
(
{
[Time].[2016]
,[Time].[2017]
}
,CrossJoin
(
{
[Quarters].[2 Quarter]
,[Quarters].[1 Quarter]
}
,{
[Measures].[Load]
,[Measures].[Flag]
}
)
)
)
} ON ROWS
,
CrossJoin
(
[Industry].[Industry 1]
,[CLient].[Set 1]
)
having [Measures].[Flag] = 1 ON COLUMNS
FROM [Cube]
WHERE
[Version].[Actual];
答案 1 :(得分:0)
您好我找到了解决此问题的方法。修复方法是使用不同的过滤器。这是一个例子:
这里需要注意的重要事项是' Flag'数据在特定维度配置中可用。
SELECT
{
NonEmpty
(
CrossJoin
(
{
[Time].[2016]
,[Time].[2017]
}
,CrossJoin
(
{
[Quarters].[2 Quarter]
,[Quarters].[1 Quarter]
}
,{
[Measures].[Load]
,[Measures].[Flag]
}
)
)
)
} ON ROWS
,{
Filter
(
CrossJoin
(
[Industry].[Industry 1]
,[CLient].[Set 1]
)
,
(
[Cube].(
[Time].[2016],
[Quarters].[1 Quarter],
[Measures].[Flag]
) = 1
)
)
} ON COLUMNS
FROM [Cube]
WHERE
[Version].[Actual];