'basic question about cubes: get string value of a dimension referred to by its key

I would like to show you what I think is a basic use of OLAP cubes, but which I can't do in SSAS.

In books talking of SSAS or OLAP cubes, facts and dimensions are often presented like this: facts contains measurable values, like height, price, numbers and so on. Dimensions are used for drill down, i.e. for filtering facts. So for example a fact can be a sales, and this fact contains a customer Id and a Product Id. A Customer dimension contains an Id (which is referred by the CustomerId of the fact), and a Product dimension contains an Id likewise.

But if I select all sales made by a given Customer(with drill down, no problem), how can I get for each sales the name of the associated product (provided there exists a Name attribute in the product dimension)?

Is it a request that has not to be asked to a cube ?(404 - bad request ;-)

I saw this link: forum which deals with the same question, I tried to adapt the answer of Ken in Tampa but without success.

EDIT: I can get a good result with this query:

WITH
MEMBER fv AS [Dim Fiv].[Name].CurrentMember.MemberValue

SELECT fv ON 0
, NONEMPTY([Dim misc].[Patient Id].[Patient Id].[{xxxxxxxx-B79F-4216-AF44-A3015F7FCE3E}]* [Dim Fiv].[Id].[Id].MEMBERS,[Measures].[VPARCOURS Nombre]) ON 1
FROM [BDD PBM]

Dim Fiv has the role of Product, the measure is the count of rows in the fact table, and Patient Id is for Customer. It's awful, very long to write. Isn't there an easier way?



Solution 1:[1]

How about something like that?

select
 [Measures].[Sales] on 0,
 [Product].[Product].[Product] on 1

 from [Sales]
 where [Customer].[Customer].[the-customer]

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marc Polizzi