Filtering by Key a dimension

Feb 6, 2014 at 8:52 AM
Hi :)

Good job dudes, but I need an example to generate this MDX query with SSAS Entity Framework:


SELECT
NON EMPTY
( [Customer].[Customer].&[21151] )

ON ROWS,
{
[Measures].[Internet Sales Amount]
}
ON COLUMNS
FROM [Adventure Works]

Thanks a lot :)
Coordinator
Feb 18, 2015 at 2:40 PM
Edited Feb 18, 2015 at 2:54 PM
This SDX LINQ query should be inline with your MDX:

from customer in dbContext.Customers
where customer.Id.Member(1151)
select customer.InternetSalesAmount

Or you could do it in a more standard LINQ way:

from customer in dbContext.Customers
where customer.Id == 1151
select customer.InternetSalesAmount

Or EF way (the most efficient but cached):
dbContext.Customers.Find(1151).InternetSalesAmount