--根据时间段统计
WITH 
SET [DateRange] AS '{[Calendar].[fullYMD].[20151216]:[Calendar].[fullYMD].[20151218]}'

SELECT
NON EMPTY CrossJoin({[IncidentSource].[Source].Members},{[Measures].[IncidentNum]}) ON 0
FROM [Incident]
WHERE [DateRange]

WITH 
SET [DateRange] AS '{[Calendar].[fullYMD].[${paramDateFrom}]:[Calendar].[fullYMD].[${paramDateTo}]}'
SELECT
NON EMPTY {[Measures].[IncidentNum]} ON 0,
NON EMPTY {[IncidentSource].[Source].Members} ON 1
FROM [Incident]
WHERE [DateRange]

--table 表格查询
WITH
SET [DateRange] AS '{[Calendar].[fullYMD].[20151216]:[Calendar].[fullYMD].[20151218]}'
SET [~COLUMNS] AS
    {[IncidentSource].[Source].Members}
SET [~ROWS] AS
    Hierarchize({{[Calendar].[YQMD].[year].Members}, {[Calendar].[YQMD].[month].Members}, {[Calendar].[YQMD].[day].Members}})
SELECT
NON EMPTY CrossJoin([~COLUMNS], {[Measures].[IncidentNum]}) ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [Incident]
WHERE [DateRange]


--事件分类Top15统计
WITH 
SET [DateRange] AS '{[Calendar].[fullYMD].[20151216]:[Calendar].[fullYMD].[20151218]}'
MEMBER [Calendar].[Range] AS 'Aggregate([DateRange],[Measures].CurrentMember)' 
SELECT
NON EMPTY {[Measures].[IncidentNum]} ON COLUMNS,
TopCount([Category].[Category].[category].Members,15,[Measures].[IncidentNum]) ON ROWS
FROM [IncidentCategory]
WHERE [Calendar].[Range]

--事件升级原因
WITH 
SET [DateRange] AS '{[Calendar].[fullYMD].[20151216]:[Calendar].[fullYMD].[20151218]}'

SELECT
NON EMPTY {[Measures].[IncidentNum]} ON 0,
NON EMPTY {[UpgradeReason].[upgradeRecode].Members} ON 1
FROM [IncidentUpgradeReason]
WHERE [DateRange]