Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SSAS - COUNT OF A DIMENSION MEMBER

Posted on 2010-09-17
2
Medium Priority
?
1,388 Views
Last Modified: 2016-02-14
Hello Folks,
I am trying to use count of a dimension member as measure.
My purpose is to count the distinct StoreID sales for the specified week of year. I have created a calculated member named StoreCount. And the formula of this calculated member is.



Count(CrossJoin({[Measures].[Sale Unit]}, [Dim Warehouses MAX].Members), ExcludeEmpty)




This calculation show the total count of the Sale Unit measure. But I have filtered this resultset for the week 17. And it still shows the all date range.

Any idea?
0
Comment
Question by:innocent1973
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Tim Humphries earned 2000 total points
ID: 33707152
Hi,

Your calculation makes no reference to your date dimension and so will not be fitered by it.

If the query you want to include the calculation in is doing something like:

nonempty( [Dim Warehouses MAX].Members, [Measures].[Sale Unit]) on rows

i.e. showing only those stores that have sales (for a week), then you should be able to just use:


Count(Existing([Dim Warehouses MAX].Members))

as your calculation. Note that this will only work if you include [Dim Warehouses MAX] in the crossjoin in your main query (otherwise there is no set of [Dim Warehouses MAX] to iterate over and you'll get the count of all stores in the dimension).

Tim
0
 

Author Closing Comment

by:innocent1973
ID: 33712418
Thank you
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question