I newbie in olap using AdventureWorksDW2008R2 db and Adventure Works 2008R2 olap with Adventure Works cube.
I want to write an mdx query as per the result using T-SQL: -
select
FactResellerSales.OrderDateKey,
SUM(FactResellerSales.SalesAmount) as 'Reseller Sales Amount'
from FactResellerSales with (nolock)
inner join DimEmployee on DimEmployee.EmployeeKey = FactResellerSales.EmployeeKey
where
FactResellerSales.OrderDateKey=20070901
and DimEmployee.FirstName='Jae' and DimEmployee.LastName='Pak'
group by FactResellerSales.OrderDateKey
The result:
OrderDateKey Reseller Sales Amount
20070901 415046.9295
Using the mdx query, I can only execute the following: -
SELECT [Measures].[Reseller Sales Amount] ON COLUMNS,
NON EMPTY [Date].[Date].members ON ROWS
FROM [Adventure Works]
WHERE [Employee].[Employees].&[291]
The result is from July 1, 2006 to June 1, 2008 with the respective Reseller Sales Amount summary for each day.
My questions are, within the mdx query WHERE clause how do I:
a) Filter by date which is September 1, 2007? It doesn't accept the date dimension.
b) Filter by Employee using the name 'Jae B. Pak' which is in a multi-level hierarchy instead of using the EmployeeKey which is 291.