标签:
数据源名称 | 数据源类型 |
dsSSAS | SSAS数据源 |
dsAnySQLDB | SQL数据源,TempDB数据库 |
序号 | 参数名称 | 描述 | 可用值 | 默认值 | 备注 |
1 | pLag | 度量、日期计算字段的关键参数。 | 12 | 图例1 | |
2 | pCube | 多维数据集 | [Adventure Works] | 图例2 | |
3 | pMeasureGroup | 度量值组 | [Sales Summary] | 图例3 | |
4 | pMeasure | 度量 | [Measures].[Gorss Profit] | 图例4 | |
5 | pRowMbr | 维度行 | [Product].[Product Categories].[Subcategory].&[1] | 图例5 | |
6 | pColMbr | 维度列 | [Sales Territory].[Sales Territory].[All Sales Territories] | 图例6 | |
7 | pRowCount | 行数 | 10 | 图例7 | |
8 | pColCount | 列数 | 5 | 图例8 | |
9 | pFilterMbr | 维度筛选器 | [Promotion].[Promotions].[All Promotions] | 图例9 | |
10 | pDateMbr | 日期筛选器 | [Date].[Calendar].[Month].&[2004]&[4] | 图例10 | |
11 | pCallingReport | 调用的报表 | [&ReportName] | 图例11 | |
12 | pTopOrBottom | 排序 | 1、-1 | 1 | 图例12 |
13 | pHighIsGoodOrBad | 用于线图中醒目标记 | Good、Bad | Good |
with member measures.x as
generate(ascendants([Date].[Calendar].currentmember)
,[Date].[Calendar].currentmember.uniquename
,".sibings,")+".sibings,"
[Date].[Calendar].[Month].&[2000]&[2].sibings
,[Date].[Calendar].[CalendarQuarter].&[2000]&[1].sibings
,[Date].[Calendar].[CalendarSemester].&[2000]&[1].sibings
,[Date].[Calendar].[CalendarYear].&[2000].sibings
,[Date].[Calendar].[AllPeriods].sibings,
TOPCOUNT(
STRTOSET("{ASCENDANTS("+@pColMbr+"),"+@pColMbr+".children}")
,StrToValue(@pColCount)
,[Measures].[ValueSort]
)
-------------------------------------------------------------------------------------------
--ReportName:CubeBrowser
--Author:GrantPaisley
--Date:25Jan2010
-------------------------------------------------------------------------------------------
WITH
--BasicMetadata
MEMBER [Measures].[Lag] AS
StrToValue(@pLag)
--MeasureMetadata
MEMBER [Measures].[Measure_Label] AS
StrToValue(@pMeasure+".Member_Name")
MEMBER [Measures].[Value] AS
StrToValue(@pMeasure)
MEMBER [Measures].[Value LY] AS
StrToValue("([Measures].[Value],"+@pDateMbr+".Hierarchy.CurrentMember.Lag("+Str([Measures].[Lag])+"))")
MEMBER [Measures].[ValueSort] AS
strToValue("([Measures].[Value],"+@pDateMbr+")*"+@pTopOrBottom)
--Date metadata
MEMBER [Measures].[Date_Label] AS
StrToValue(@pDateMbr+".Hierarchy.CurrentMember.Member_Caption")
MEMBER [Measures].[Date_Key] AS
StrToValue(@pDateMbr+".Hierarchy.Currentmember.Uniquename")
MEMBER [Measures].[Date_Level] AS
StrToValue(@pDateMbr+".Hierarchy.CurrentMember.Level.Ordinal")
MEMBER [Measures].[DateLY_Label] AS
StrToValue(@pDateMbr+".Hierarchy.CurrentMember.Lag("+Str([Measures].[Lag])+").Member_Caption")
MEMBER [Measures].[DateLY_Key] AS
StrToValue(@pDateMbr+".Hierarchy.Currentmember.Lag("+Str([Measures].[Lag])+").Uniquename")
--Row metadata
MEMBER [Measures].[Row_Label] AS
StrToValue(@pRowMbr+".Hierarchy.CurrentMember.Member_Caption")
MEMBER [Measures].[Row_Key] AS
StrToValue(@pRowMbr+".Hierarchy.Currentmember.Uniquename")
MEMBER [Measures].[Row_Level_Name] AS
StrToValue(@pRowMbr+".Hierarchy.Level.Name")
MEMBER [Measures].[Row_Level] AS
StrToValue(@pRowMbr+".Hierarchy.CurrentMember.Level.Ordinal")
MEMBER [Measures].[Row_Hierarchy_Name] AS
StrToValue(@pRowMbr+".Hierarchy.Name")
MEMBER [Measures].[Row_Hierarchy_UniqueName] AS
StrToValue(@pRowMbr+".Hierarchy.UniqueName")
MEMBER [Measures].[Row_Dimension_Name] AS
StrToValue(@pRowMbr+".Dimension.Name")
MEMBER [Measures].[Row_Dimension_UniqueName] AS
StrToValue(@pRowMbr+".Dimension_Unique_Name")
--Column metadata
MEMBER [Measures].[Col_Label] AS
StrToValue(@pColMbr+".Hierarchy.CurrentMember.Member_Caption")
MEMBER [Measures].[Col_Key] AS
StrToValue(@pColMbr+".Hierarchy.CurrentMember.UniqueName")
MEMBER [Measures].[Col_Level_Name] AS
StrToValue(@pColMbr+".Hierarchy.Level.Name")
MEMBER [Measures].[Col_Level] AS
StrToValue(@pColMbr+".Hierarchy.CurrentMember.Level.Ordinal")
MEMBER [Measures].[Col_Hierarchy_Name] AS
StrToValue(@pColMbr+".Hierarchy.Name")
MEMBER [Measures].[Col_Hierarchy_UniqueName] AS
StrToValue(@pColMbr+".Hierarchy.UniqueName")
MEMBER [Measures].[Col_Dimension_Name] AS
StrToValue(@pColMbr+".Dimension.Name")
MEMBER [Measures].[Col_Dimension_UniqueName] AS
StrToValue(@pColMbr+".Dimension_Unique_Name")
--Filter metadata
MEMBER [Measures].[Filter_Label] AS
StrToValue(@pFilterMbr+".Hierarchy.CurrentMember.Member_Caption")
MEMBER [Measures].[Filter_Key] AS
StrToValue(@pFilterMbr+".Hierarchy.Currentmember.Uniquename")
MEMBER [Measures].[Filter_Level_Name] AS
StrToValue(@pFilterMbr+".Hierarchy.Level.Name")
MEMBER [Measures].[Filter_Level] AS
StrToValue(@pFilterMbr+".Hierarchy.CurrentMember.Level.Ordinal")
MEMBER [Measures].[Filter_Hierarchy_Name] AS
StrToValue(@pFilterMbr+".Hierarchy.Name")
MEMBER [Measures].[Filter_Hierarchy_UniqueName] AS
StrToValue(@pFilterMbr+".Hierarchy.UniqueName")
MEMBER [Measures].[Filter_Dimension_Name] AS
StrToValue(@pFilterMbr+".Dimension.Name")
MEMBER [Measures].[Filter_Dimension_UniqueName] AS
StrToValue(@pFilterMbr+".Dimension_Unique_Name")
SELECT NON EMPTY {
---------------------
[Measures].[Lag],
---------------------
[Measures].[Measure_Label],
[Measures].[Value],
[Measures].[Value LY],
[Measures].[ValueSort],
---------------------
[Measures].[Date_Label],
[Measures].[Date_Key],
[Measures].[Date_Level],
[Measures].[DateLY_Key],
[Measures].[DateLY_Label],
---------------------
[Measures].[Row_Label],
[Measures].[Row_Key],
[Measures].[Row_Level_Name],
[Measures].[Row_Level],
[Measures].[Row_Hierarchy_Name],
[Measures].[Row_Hierarchy_UniqueName],
[Measures].[Row_Dimension_Name],
[Measures].[Row_Dimension_UniqueName],
---------------------
[Measures].[Col_Label],
[Measures].[Col_Key],
[Measures].[Col_Level_Name],
[Measures].[Col_Level],
[Measures].[Col_Hierarchy_Name],
[Measures].[Col_Hierarchy_UniqueName],
[Measures].[Col_Dimension_Name],
[Measures].[Col_Dimension_UniqueName],
---------------------
[Measures].[Filter_Label],
[Measures].[Filter_Key],
[Measures].[Filter_Level_Name],
[Measures].[Filter_Level],
[Measures].[Filter_Hierarchy_Name],
[Measures].[Filter_Hierarchy_UniqueName],
[Measures].[Filter_Dimension_Name],
[Measures].[Filter_Dimension_UniqueName]
} ON COLUMNS,
{
(
STRTOMEMBER(@pDateMbr):STRTOMEMBER(@pDateMbr+".lag("+Str([Measures].[Lag]-1)+")")
*TOPCOUNT(
STRTOSET("{ASCENDANTS("+@pColMbr+"),"+@pColMbr+".children}")
,StrToValue(@pColCount)
,[Measures].[ValueSort]
)
*TOPCOUNT(
STRTOSET("{ASCENDANTS("+@pRowMbr+"),"+@pRowMbr+".children}")
,StrToValue(@pRowCount)
,[Measures].[ValueSort]
------------------------------ only want parent,selfand children
-- STRTOSET("{"+@pRowMbr+".parent,"+@pRowMbr+","+@pRowMbr+".children}")
------------------------------ want ancestors,selfand children & siblings
-- STRTOSET("{"+
-- GENERATE(
--Ascendants(StrToMember(@pRowMbr))
--,StrToValue(@pRowMbr+".Hierarchy.CurrentMember.Uniquename")
--,".siblings,"
--)+".siblings,"
--+@pRowMbr+".children"
--+"}"
--)
)
)
} ON ROWS
FROM [AdventureWorks]
WHERE STRTOSET(@pFilterMbr)
=iif(Fields!Col_Key.Value=Parameters!pColMbr.Value
orFields!Row_Key.Value=Parameters!pRowMbr.Value,
"LemonChiffon",
Nothing
)
=iif(Fields!Col_Key.Value=Parameters!pColMbr.Value
orFields!Row_Key.Value=Parameters!pRowMbr.Value,
"LemonChiffon",
Nothing
)
= iif(Parameters!pHighIsGoodOrBad.Value="Good",
iif(Fields!Value.Value>Fields!Value_LY.Value,"Black","Red"),
iif(Fields!Value.Value>Fields!Value_LY.Value,"Red","Black")
)
=Fields!Measure_Label.Value+" was "
+FormatNumber(Last(Fields!Value.Value))
+" in "+Last(Fields!Date_Label.Value)
=iif(last(abs(Fields!Value.Value))>10000000,"#,, m;(#,, m)",
iif(last(abs(Fields!Value.Value))>1000000,"#,,.0 m;(#,,.0 m)",
iif(last(abs(Fields!Value.Value))>10000,"#, k;(#, k)",
iif(last(abs(Fields!Value.Value))>1000,"#,.0 k;(#,.0 k)",
"#,#;(#,#)"))))
提示:
=Fields!Measure_Label.Value+" was "
+FormatNumber(Last(Fields!Value_LY.Value))
+" in "+Last(Fields!DateLY_Label.Value)
自定义格式:
=iif(last(abs(Fields!Value_LY.Value))>10000000,"#,, m;(#,, m)",
iif(last(abs(Fields!Value_LY.Value))>1000000,"#,,.0 m;(#,,.0 m)",
iif(last(abs(Fields!Value_LY.Value))>10000,"#,#, k;(#,#, k)",
iif(last(abs(Fields!Value_LY.Value))>1000,"#,#,.0 k;(#,#,.0 k)",
"#,#;(#,#)"))))
提示:
="swap "+Fields!Row_Hierarchy_Name.Value
+"(rows) with "+Fields!Filter_Hierarchy_Name.Value
+"(filter)"
提示:
="swap "+Fields!Row_Hierarchy_Name.Value
+"(rows) with "+Fields!Col_Hierarchy_Name.Value
+"(columns)"
select‘1‘asValue,‘Top‘asValueName
union
select‘-1‘,‘Bottom‘
=iif(Parameters!pTopOrBottom.Value=Fields!value.Value,
"DimGray",
"CornflowerBlue"
)
Select5asCellCount
union all
select6
union all
select7
union all
select10
union all
select20
union all
select50
=iif(Parameters!pColCount.Value=Fields!CellCount.Value,
"DimGray",
"CornflowerBlue"
)
Select2asLag
union all
select3
union all
select4
union all
select6
union all
select7
union all
select12
=iif(Parameters!pLag.Value=Fields!Lag.Value,
"DimGray",
"CornflowerBlue"
)
= left(First(Fields!Date_Label.Value),3)+" "
+ right(First(Fields!Date_Label.Value),4)+" - "
+ left(Last(Fields!Date_Label.Value),3)+" "
+ right(Last(Fields!Date_Label.Value),4)
="run by "&User!UserID+" in "+
IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).TotalSeconds<1
,
"< 1 second" ,
(IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).Hours>0
,System.DateTime.Now.Subtract(Globals!ExecutionTime).Hours&" hour(s), "
,"")+
IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).Minutes>0
,System.DateTime.Now.Subtract(Globals!ExecutionTime).Minutes&" minute(s), "
,"")+
IIf(System.DateTime.Now.Subtract(Globals!ExecutionTime).Seconds>0
,System.DateTime.Now.Subtract(Globals!ExecutionTime).Seconds&" second(s)"
,"")
)
)
=Parameters!pDateMbr.Value+VbCrLf
+Parameters!pCube.Value+VbCrLf
+Parameters!pMeasureGroup.Value+VbCrLf
+Parameters!pMeasure.Value+VbCrLf
+Parameters!pRowMbr.Value+VbCrLf
+Parameters!pColMbr.Value+VbCrLf
+Parameters!pFilterMbr.Value
-----------------------------------------------------------------------------
--GrantPaisley
--AngryKoala
--28Nov2008
-----------------------------------------------------------------------------
WITH
MEMBER [Measures].[Lag] AS
iif(left(@pLag,1)="[",12,StrToValue(@pLag))
MEMBER [Measures].[Measure_Label] AS
iif(left(@pMeasure,10)="[Measures]"
,StrToValue(@pMeasure+".Member_Name")
,StrToValue("[Measures].[Reseller Sales Amount].Member_Name")
)
MEMBER [Measures].[Value] AS
iif(left(@pMeasure,10)="[Measures]"
,StrToValue(@pMeasure)
,StrToValue("[Measures].[Reseller Sales Amount]")
)
MEMBER [Measures].[Value LY] AS
StrToValue("( [Measures].[Value], "+@pDateMbr
+".Hierarchy.CurrentMember.Lag("
+Str([Measures].[Lag])+")) "
)
MEMBER [Measures].[Date_Label] AS
StrToValue(@pDateMbr+".Hierarchy.CurrentMember.Member_Caption")
MEMBER [Measures].[Date_Key] AS
StrToValue(@pDateMbr+".Hierarchy.Currentmember.Uniquename")
MEMBER [Measures].[Date_Level] AS
StrToValue(@pDateMbr+".Hierarchy.CurrentMember.Level.Ordinal")
MEMBER [Measures].[DateLY_Label] AS
StrToValue(@pDateMbr+".Hierarchy.CurrentMember.Lag("
+Str([Measures].[Lag])+" ).Member_Caption "
)
MEMBER [Measures].[DateLY_Key] AS
StrToValue(@pDateMbr+".Hierarchy.Currentmember.Lag("
+Str([Measures].[Lag])+" ).Uniquename")
MEMBER [Measures].[RowFocus] AS
strtovalue(‘"‘+@pRowMbr+‘"‘)
MEMBER [Measures].[ColFocus] AS
strtovalue(‘"‘+@pColMbr+‘"‘)
MEMBER [Measures].[Row_Label] AS
StrToValue(@pRowMbr+".Hierarchy.CurrentMember.Member_Caption")
MEMBER [Measures].[Row_Key] AS
StrToValue(@pRowMbr+".Hierarchy.Currentmember.Uniquename")
MEMBER [Measures].[Row_Level_Name] AS
StrToValue(@pRowMbr+".Hierarchy.Level.Name")
MEMBER [Measures].[Row_Level] AS
StrToValue(@pRowMbr+".Hierarchy.CurrentMember.Level.Ordinal")
MEMBER [Measures].[Row_Dimension_Name] AS
StrToValue(@pRowMbr+".Dimension.Name")
MEMBER [Measures].[Row_Hierarchy_Name] AS
StrToValue(@pRowMbr+".Hierarchy.Name")
MEMBER [Measures].[Col_Label] AS
StrToValue(@pColMbr+".Hierarchy.CurrentMember.Member_Caption")
MEMBER [Measures].[Col_Key] AS
StrToValue(@pColMbr+".Hierarchy.CurrentMember.UniqueName")
MEMBER [Measures].[Col_Level_Name] AS
StrToValue(@pColMbr+".Hierarchy.Level.Name")
MEMBER [Measures].[Col_Level] AS
StrToValue(@pColMbr+".Hierarchy.CurrentMember.Level.Ordinal")
MEMBER [Measures].[Col_Dimension_Name] AS
StrToValue(@pColMbr+".Dimension.Name")
MEMBER [Measures].[Col_Hierarchy_Name] AS
StrToValue(@pColMbr+".Hierarchy.Name")
SELECT NON EMPTY {
[Measures].[Lag],
[Measures].[Date_Key],
[Measures].[Date_Label],
[Measures].[Date_Level],
[Measures].[DateLY_Key],
[Measures].[DateLY_Label],
[Measures].[Measure_Label],
[Measures].[RowFocus],
[Measures].[Row_Key],
[Measures].[Row_Label],
[Measures].[Row_Level],
[Measures].[Row_Level_Name],
[Measures].[Row_Hierarchy_Name],
[Measures].[Row_Dimension_Name],
[Measures].[ColFocus],
[Measures].[Col_Key],
[Measures].[Col_Label],
[Measures].[Col_Level],
[Measures].[Col_Level_Name],
[Measures].[Col_Hierarchy_Name],
[Measures].[Col_Dimension_Name],
[Measures].[Value],
[Measures].[Value LY]
} ON COLUMNS,
NON EMPTY {(
STRTOMEMBER(@pDateMbr):STRTOMEMBER(@pDateMbr+".lag("+Str([Measures].[Lag]-1)+")")
*STRTOSET("{"+[Measures].[ColFocus]+"}")
*STRTOSET("{"+[Measures].[RowFocus]+"}")
)}--DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME
ON ROWS
FROM [AdventureWorks]
WHERE STRTOMEMBER(@pFilterMbr)
--CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
=left(First(Fields!Date_Label.Value),3)
+" - "
+ left(Last(Fields!Date_Label.Value),3)
+ right(Last(Fields!Date_Label.Value),5)
=iif(last(abs(Fields!Value.Value))>10000000,"#,, m;(#,, m)",
iif(last(abs(Fields!Value.Value))>1000000,"#,,.0 m;(#,,.0 m)",
iif(last(abs(Fields!Value.Value))>10000,"#,#, k;(#,#, k)",
iif(last(abs(Fields!Value.Value))>1000,"#,#,.0 k;(#,#,.0 k)",
"#,#;(#,#)"))))
=Fields!Measure_Label.Value+" was "
+FormatNumber(Last(Fields!Value.Value))
+" in "+Last(Fields!Date_Label.Value)
=iif(last(abs(Fields!Value.Value))>10000000,"#,, m;(#,, m)",
iif(last(abs(Fields!Value.Value))>1000000,"#,,.0 m;(#,,.0 m)",
iif(last(abs(Fields!Value.Value))>10000,"#,#, k;(#,#, k)",
iif(last(abs(Fields!Value.Value))>1000,"#,#,.0 k;(#,#,.0 k)",
"#,#;(#,#)"))))
=Fields!Measure_Label.Value+" was "
+FormatNumber(Last(Fields!Value_LY.Value))
+" in "+Last(Fields!DateLY_Label.Value)
=iif(last(abs(Fields!Value_LY.Value))>10000000,"#,, m;(#,, m)",
iif(last(abs(Fields!Value_LY.Value))>1000000,"#,,.0 m;(#,,.0 m)",
iif(last(abs(Fields!Value_LY.Value))>10000,"#,#, k;(#,#, k)",
iif(last(abs(Fields!Value_LY.Value))>1000,"#,#,.0 k;(#,#,.0 k)",
"#,#;(#,#)"))))
=iif(abs(Fields!Value.Value)>10000000,"#,, m;(#,, m)",
iif(abs(Fields!Value.Value)>1000000,"#,,.0 m;(#,,.0 m)",
iif(abs(Fields!Value.Value)>10000,"#, k;(#, k)",
iif(abs(Fields!Value.Value)>1000,"#,.0 k;(#,.0 k)",
"#,#;(#,#)"))))
="select * from $System.MDSCHEMA_CUBES WHERE CUBE_SOURCE = 1 AND [CATALOG_NAME] = ‘"
&Parameters!pDatabase.Value&"‘"
查询:
="select * from $System.MDSCHEMA_DIMENSIONS WHERE CUBE_NAME = ‘"
&Parameters!pCube.Value&"‘"
=iif(Parameters!pDriver.Value="pMeasure",
"Select a cube and measure",
iif(Parameters!pDriver.Value="pRowMbr",
"Select another hierarchy for Rows",
"Select another hierarchy for Columns"
)
)
="select * from $System.MDSCHEMA_HIERARCHIES"
+" WHERE CUBE_NAME = ‘"&Parameters!pCube.Value&"‘"
="Select * from $System.MDSCHEMA_MEASUREGROUP_DIMENSIONS "
+" WHERE CUBE_NAME = ‘"&Parameters!pCube.Value&"‘"
+" AND MEASUREGROUP_NAME = ‘"&Parameters!pMeasureGroup.Value&"‘"
="select * from $System.MDSCHEMA_LEVELS WHERE CUBE_NAME = ‘"
&Parameters!pCube.Value&"‘"
="Select * from $System.MDSCHEMA_MEASUREGROUPS WHERE CUBE_NAME = ‘"
&Parameters!pCube.Value&"‘"
="Select * from $System.MDSCHEMA_MEASURES"
+" WHERE CUBE_NAME = ‘"&Parameters!pCube.Value&"‘"
+" AND ( MEASUREGROUP_NAME = ‘"&Parameters!pMeasureGroup.Value&"‘"
+" OR MEASURE_DISPLAY_FOLDER = ‘"&Parameters!pMeasureGroup.Value&"‘ )"
=iif(Parameters!pDriver.Value="pMeasure",
"Select a cube and measure",
iif(Parameters!pDriver.Value="pRowMbr",
"Select another hierarchy for Rows",
"Select another hierarchy for Columns")
)
=right(
left(
Fields!DIMENSION_UNIQUE_NAME.Value,
len(Fields!DIMENSION_UNIQUE_NAME.Value)-1
),
len(Fields!DIMENSION_UNIQUE_NAME.Value)-2
)
=iif(Fields!DIMENSION_UNIQUE_NAME.Value=Parameters!pDimension.Value
,"LemonChiffon","White")
=iif(Fields!HIERARCHY_UNIQUE_NAME.Value=Parameters!pHierarchy.Value
,"LemonChiffon","White")
=iif(Parameters!pDriver.Value="RowMbr",
Fields!DEFAULT_MEMBER.Value,
Parameters!pRowMbr.Value
)
=iif(Parameters!pDriver.Value="ColMbr",
Fields!DEFAULT_MEMBER.Value,
Parameters!pColMbr.Value
)
=iif(Parameters!pDriver.Value="FilterMbr",
Fields!DEFAULT_MEMBER.Value,
Parameters!pFilterMbr.Value
)
=iif(Fields!MEASUREGROUP_NAME.Value=Parameters!pMeasureGroup.Value
,"LemonChiffon","White")
--------------------------------------------------------------------
--GrantPaisley
--AngryKoala
--Nov2011
--------------------------------------------------------------------
WITH
MEMBER [Measures].[Mbr_Key] AS
iif(@pDriver="DateMbr",@pDateMbr,
iif(@pDriver="RowMbr",@pRowMbr,
iif(@pDriver="ColMbr",@pColMbr,
iif(@pDriver="FilterMbr",@pFilterMbr,@pDateMbr))))
MEMBER [Measures].[Measure_Label] AS
iif(left(@pMeasure,10)="[Measures]"
,StrToValue(@pMeasure+".Member_Name")
,StrToValue("[Measures].[Reseller Order Quantity].Member_Name"))
MEMBER [Measures].[Value] AS
iif(left(@pMeasure,10)="[Measures]"
,StrToValue(@pMeasure)
,StrToValue("[Measures].[Reseller Order Quantity]"))
MEMBER [Measures].[RowFocus] AS
strtovalue(‘"‘+[Measures].[Mbr_Key]+‘"‘)
MEMBER [Measures].[Row_Label] AS
StrToValue([Measures].[Mbr_Key]+".Hierarchy.CurrentMember.Member_Caption")
MEMBER [Measures].[Row_Key] AS
StrToValue([Measures].[Mbr_Key]+".Hierarchy.Currentmember.Uniquename")
MEMBER [Measures].[Row_Level_Name] AS
StrToValue([Measures].[Mbr_Key]+".Hierarchy.Level.Name")
MEMBER [Measures].[Row_Level] AS
StrToValue([Measures].[Mbr_Key]+".Hierarchy.CurrentMember.Level.Ordinal")
MEMBER [Measures].[Row_Hierarchy_Name] AS
StrToValue([Measures].[Mbr_Key]+".Hierarchy.Name")
MEMBER [Measures].[Row_Dimension_Name] AS ‘
StrToValue([Measures].[Mbr_Key]+".Dimension.Name")
MEMBER [MEASURES].MbrIsAncestor AS
Strtovalue("IsAncestor( "+[Measures].[Mbr_Key]+".hierarchy.currentmember, "+[Measures].[Mbr_Key]+" )"
+"or("+[Measures].[Mbr_Key]+".hierarchy.currentmember is "+[Measures].[Mbr_Key]+")"
)
SELECT NON EMPTY {
[Measures].[Measure_Label],
[Measures].[Mbr_Key],
[Measures].[RowFocus],
[Measures].[Row_Key],
[Measures].[Row_Label],
[Measures].[Row_Level],
[Measures].[Row_Level_Name],
[Measures].[Row_Hierarchy_Name],
[Measures].[Row_Dimension_Name],
[Measures].[MbrIsAncestor],
[Measures].[Value]
} ON COLUMNS,
NON EMPTY {(
STRTOSET("{"+
GENERATE(
ASCENDANTS(STRTOMEMBER([Measures].[RowFocus]))
,STRTOVALUE([Measures].[RowFocus]+".Hierarchy.CURRENTMEMBER.Uniquename")
,".siblings, "
)+".siblings,"
+[Measures].[RowFocus]+".children"
+"}")
)}
ON ROWS
FROM [AdventureWorks]
Select5asCellCount
union all
select6
union all
select7
union all
select10
union all
select20
union all
select50
Select2asLag
union all
select3
union all
select4
union all
select6
union all
select12
=iif(Parameters!pDriver.Value="DateMbr"
,Fields!Row_Key.Value
,Parameters!pDateMbr.Value)
=iif(Parameters!pDriver.Value="RowMbr"
,Fields!Row_Key.Value
,Parameters!pRowMbr.Value)
=iif(Parameters!pDriver.Value="ColMbr"
,Fields!Row_Key.Value
,Parameters!pColMbr.Value)
=iif(Parameters!pDriver.Value="FilterMbr"
,Fields!Row_Key.Value
,Parameters!pFilterMbr.Value)
=iif(Fields!MbrIsAncestor.Value,
"+ ==>",
"+"
)
=iif(Parameters!pDriver.Value="DateMbr"
,Fields!Row_Key.Value
,Parameters!pDateMbr.Value)
=iif(Parameters!pDriver.Value="RowMbr"
,Fields!Row_Key.Value
,Parameters!pRowMbr.Value)
=iif(Parameters!pDriver.Value="ColMbr"
,Fields!Row_Key.Value
,Parameters!pColMbr.Value)
=iif(Parameters!pDriver.Value="FilterMbr"
,Fields!Row_Key.Value
,Parameters!pFilterMbr.Value)
标签:
原文地址:http://www.cnblogs.com/hispring/p/4453168.html