我在 Visual Studio 2005 中基于 SSAS 2008 R2 Qube 数据源构建了一个 SSRS 收入报告,用于部署在 MS SharePoint 2005 Server 上。它运行良好(俄语):
(哎呀,不能发布低于 10 点声誉的图片)
但问题是报告的 mdx 以不同的度量输出重复的 x2/x3/x4/x10 统计数据,这些统计数据被加载到不同级别的日历层次结构中(一些计划具有每年粒度,其他季度,事实数据位于精确的叶子级别日期)。这是 mdx 代码摘要:
/* Revenue plan-fact report for business units
(simplified translated abstact,
initially built for new 2015 and old clients) */
/*============================================================================
CALCULATED MEASURES
============================================================================*/
WITH
MEMBER [is new client] AS
CASE
WHEN [Clients].[First contract calendar].CURRENTMEMBER =
[Clients].[First contract calendar].[Year START DATE].&[2015-01-01T00:00:00]
THEN 1 ELSE 0 END
MEMBER [Measures].[New clients - Revenue Plan] AS
CASE WHEN [is new client] = 1
THEN [Measures].[New clients - Revenue Plan]
ELSE null END
MEMBER [Measures].[New clients - Revenue Fact] AS
CASE WHEN [is new client] = 1
THEN [Measures].[New clients - Revenue Fact]
ELSE null END
MEMBER [Measures].[New cients - contracts Plan] AS
CASE WHEN [is new client] = 1
THEN [Measures].[New cients - contracts Plan]
ELSE null END
/*============================================================================
CONSTRACT DATA SET
============================================================================*/
SELECT {[Measures].[New clients - Revenue Plan],
[Measures].[New clients - Revenue Fact],
[Measures].[New cients - contracts Plan]} ON COLUMNS,
--exists(
--nonempty(
CrossJoin(
-- dimention of client's first contract calendar
-- (we need it to calculate measure of new/old client flag):
-- drill down from years through quarters to monthes
Hierarchize(DrilldownMember({
{DrilldownLevel({[Clients].[First contract calendar].[Year START DATE]})}},
{[Clients].[First contract calendar].[Quarter START DATE]})
-{[Clients].[First contract calendar].[Month START DATE].&[1899-12-30T00:00:00]}),
-- dimention of company's business structure (to show in report rows)
Hierarchize(DrilldownMember({
{DrilldownLevel({[Business structure].[Hierarchi].[ALL]})}},
{[Business structure].[Hierarchi].[LV1].&[3]})
-{[Business structure].[Hierarchi].[ALL],
[Business structure].[Hierarchi].[LV1].&[3],
[Business structure].[Hierarchi].[LV2].&[3]})
)
--))
ON ROWS
FROM [DWH_FD_client_count]
这导致数据集在不同级别的日历层次结构中具有加倍的统计信息:
(哎呀,不能发布低于 10 点声誉的图片)
我已经尝试过exists()、nonempty()、nonemptycrossjoin() 和filter() 函数——但这都会导致部分业务部门出现统计数据空白。我认为根本问题是 Qube 测量的粒度。但我不能影响这一点,我需要在 Report Server 的 mdx 方面制作好数字。可能是,我需要修改 [Clients].[First contract calendar] 度量层次结构的钻取块。
请帮帮我,伙计们!我到现在两周都无法克服这个问题