我正在尝试使用计算成员构建带有参数的查询。
我已经为“硬编码”的司法计数创建了计算成员,并且我创建的参数不会影响每个组的总数。
但是,我需要使用工作参数列出每个总计数。如果所选司法类型没有值,则应显示零计数。
我确定有一个简单的方法,但我对 MDX/SSRS 相当陌生。任何帮助是极大的赞赏!
这是查询:
WITH
Member [Measures].[Jud] as
(
[Dim Foreclosure Loan].[Judicial Flag].[1],
[Dim Foreclosure Loan].[FCL Stage].&[Sale Held],
[Measures].[Loan Count]
)
Member [Measures].[Non-Jud] as
(
[Dim Foreclosure Loan].[Judicial Flag].[0],
[Dim Foreclosure Loan].[FCL Stage].&[Sale Held],
[Measures].[Loan Count]
)
Member [Measures].[Total] as
(
[Dim Foreclosure Loan].[Judicial Flag],
[Dim Foreclosure Loan].[FCL Stage].&[Sale Held],
[Measures].[Loan Count]
)
-------------------------------- Query Begins --------------------------------
SELECT NON EMPTY
{
([Dim Date].[Calendar].[Day].Members)
} ON ROWS,
NON EMPTY
({
([Measures].[Jud]),
([Measures].[Non-Jud]),
([Measures].[Total])
}) ON COLUMNS
FROM ( SELECT ( STRTOSET(@DimForeclosureLoanJudicialFlag, CONSTRAINED) ) ON COLUMNS
FROM [Foreclosure])
WHERE
(IIF( STRTOSET(@DimForeclosureLoanJudicialFlag, CONSTRAINED).Count = 1,
STRTOSET(@DimForeclosureLoanJudicialFlag, CONSTRAINED),
[Dim Foreclosure Loan].[Judicial Flag].currentmember)
)CELL PROPERTIES VALUE
更新:需要有关提供的 iif 语句的帮助;请参阅下面的评论。