MDX Dynamic Dimension Attribute

Below is code that I developed a few years back that gets handy from time to time. It allows me to change dimension attribute dynamically in SSRS and also helps me to convenience certain people that says it is impossible ;)

I'm not going to describe in details but hopefully it will help some of you; the way it is now:

 

="WITH " &
" member [Measures].[MeasureName] as " &
" " & Parameters!MeasureName.Value &
" member [Measures].[DimensionAttribute1] as " &
" " & Parameters!DimensionAttribute1.Value & ".currentMember.name " &
" member [Measures].[DimensionAttribute1_1] as " &
" " & Parameters!DimensionAttribute1_1.Value & ".currentMember.name " &
" " &
"SELECT " &
" NON EMPTY " &
" { " &
"[Measures].[MeasureName]" &
",[Measures].[DimensionAttribute1]"&
",[Measures].[DimensionAttribute1_1]" &
"} ON COLUMNS " &
" ,NON EMPTY " &
" { " & Parameters!DimensionAttribute1.Value & ".CHILDREN" &
" * " & Parameters!DimensionAttribute1_1.Value & ".CHILDREN" &

" From CubeName"

Hope that helps

Emil


SHARE:


No data was returned.


Disclaimer: While every caution has been taken to provide our readers with most accurate information and honest analysis, please use your discretion before taking any decisions based on the information in this blog. Author will not compensate you in any way whatsoever if you ever happen to suffer a loss/inconvenience/damage because of/while making use of information in this blog.