Jessica Mallick
Jessica Mallick

Reputation: 63

Sum/Count of dimension attributes in MDX

I have a situation where I have to count all the accounts for which Account Category is municipal. Below is the snapshot that shows the dimension/attributes. Please look into it and advise. I have also tried using count/sum function but it did not help. Please guide me.

https://i.sstatic.net/qX8Y2.jpg

Upvotes: 1

Views: 1425

Answers (1)

FrankPl
FrankPl

Reputation: 13315

I am assuming that the attribute you want to count is [Account].[Account]. Then you could define the count as a new measure using the Count function and use [Account].[Account Category].[Municipal] in the WHERE clause:

WITH Member Measures.[Municipal Count] AS
     [Account].[Account].[Account].Members.Count
SELECT { Measures.[Municipal Count] }
       ON COLUMNS
  FROM [Your Cube]
 WHERE [Account].[Account Category].[Municipal]

Upvotes: 1

Related Questions