Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

Newbie on MDX: How to use dimension as a query parameter?

$
0
0
[code="other"] SELECT NON EMPTY {([Measures].[Agent - Prcnt Default AUX0]), ([Measures].[Table - Info A]), ([Measures].[Table - Info B]), ([Measures].[Table - Info C])} ON COLUMNS, [Dim Employee Main].[Employees].[Employee] on rows FROM ( SELECT ( STRTOMEMBER(@FromDimTimeDays, CONSTRAINED) : STRTOMEMBER(@ToDimTimeDays, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(@DimEmployeeEmployeeRole, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(@DimEmployeeLevelManager, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(@DimBusinessAccounts, CONSTRAINED) ) ON COLUMNS FROM ( SELECT ( STRTOSET(@DimLocationSites, CONSTRAINED) ) ON COLUMNS FROM [Cube Table]))))) WHERE ( IIF( STRTOSET(@DimLocationSites, CONSTRAINED).Count = 1, STRTOSET(@DimLocationSites, CONSTRAINED), [Dim Location].[Sites].currentmember ), IIF( STRTOSET(@DimBusinessAccounts, CONSTRAINED).Count = 1, STRTOSET(@DimBusinessAccounts, CONSTRAINED), [Dim Business].[Accounts].currentmember ), IIF( STRTOSET(@DimEmployeeLevelManager, CONSTRAINED).Count = 1, STRTOSET(@DimEmployeeLevelManager, CONSTRAINED), [Dim Employee].[Level 1 Manager].currentmember ), IIF( STRTOSET(@DimEmployeeEmployeeRole, CONSTRAINED).Count = 1, STRTOSET(@DimEmployeeEmployeeRole, CONSTRAINED), [Dim Employee].[Employee Role].currentmember )) CELL PROPERTIES VALUE [/code]Goal: To pull all employees all at once and to be able to pull a single employee profile. However, I do not know how I can include the dimension Employees as a query parameter.

Viewing all articles
Browse latest Browse all 1341