I am very new to MDX, so probably I’m missing something very simple.
In my cube, I have a dimension [Asset] and a measure [Visits], calculating (in this case) how many visits an asset has been consumed by. An important thing to note is that not every visit is associated with an asset.
What I need to find out is how many visits there are that consumed at least one asset. I wrote the following query:
SELECT
[Asset].[All] ON COLUMNS,
[Measures].[Visits] ON ROWS
FROM
[Analytics]
But this query just returns the total number of visits in the cube. I tried applying the NON EMPTY modifier to both axes, but that doesn’t help.
This query should give you what you expect:
You may need to put
{[Asset].[Asset Name].[All]}as second argument of Except if the All member was not excluded.In the query I create a calculated member
[Asset].[Asset Name].[all assets]that should represent all your existing assets. I supposed that your existing assets are all the members of the level[Asset].[Asset Name]but theAllmember.You can find more information about the Aggregate function here.