参数--在已选择的年度中选择月份

--=======================================================
[维度表_日期].[年季月日].[年份].&[2012].&[2季度].&[06]
--=======================================================
SELECT

  NON EMPTY { [Measures].[T1], [Measures].[T2], [Measures].[T3] } ON COLUMNS
, NON EMPTY { ([维度表_时间].[每小时].[每小时].ALLMEMBERS * [维度表_ZZZ].[ZZZ].[ZZZ].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS

FROM ( SELECT ( STRTOSET(@[维度表日期月份], CONSTRAINED) ) ON COLUMNS
FROM ( SELECT ( STRTOSET(@[维度表日期年份], CONSTRAINED) ) ON COLUMNS
FROM [xxx]))

WHERE (
IIF( STRTOSET(@[维度表日期年份], CONSTRAINED).Count = 1, STRTOSET(@[维度表日期年份], CONSTRAINED), [维度表_日期].[年份].currentmember ),
IIF( STRTOSET(@[维度表日期月份], CONSTRAINED).Count = 1, STRTOSET(@[维度表日期月份], CONSTRAINED), [维度表_日期].[月份].currentmember ) )
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
--=======================================================

WITH MEMBER [Measures].[ParameterCaption] AS [维度表_日期].[月份].CURRENTMEMBER.MEMBER_CAPTION MEMBER [Measures].[ParameterValue] AS [维度表_日期].[月份].CURRENTMEMBER.UNIQUENAME MEMBER [Measures].[ParameterLevel] AS [维度表_日期].[月份].CURRENTMEMBER.LEVEL.ORDINAL SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,
order(
 filter([维度表_日期].[月份].ALLMEMBERS ,[ParameterLevel]<>0),[ParameterCaption] ,desc)
ON ROWS
FROM ( SELECT ( STRTOSET(@[维度表日期年份], CONSTRAINED) ) ON COLUMNS
FROM [xxx])
--=======================================================
WITH MEMBER [Measures].[ParameterCaption] AS [维度表_日期].[年份].CURRENTMEMBER.MEMBER_CAPTION MEMBER [Measures].[ParameterValue] AS [维度表_日期].[年份].CURRENTMEMBER.UNIQUENAME MEMBER [Measures].[ParameterLevel] AS [维度表_日期].[年份].CURRENTMEMBER.LEVEL.ORDINAL
SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS
, order(filter([维度表_日期].[年份].ALLMEMBERS ,[ParameterLevel]<>0),[ParameterCaption],desc)
ON ROWS
FROM [xxx]

posted @ 2012-07-09 10:58  chunshen  阅读(512)  评论(0编辑  收藏  举报