Disappearing SSAS named set

Today i discovered something that could be interesting for you if you work with multidimensional projects in MS technology. I’ve got calculations in my project some of them was named sets, I would like to test them during the final step of the project. Everything was ok but few named sets wasn’t visible in the client tool. Let’s check this on AdventureWorks sample.

1

Let’s say that we want to create set that contain only active promotions but our company provide some promotions after first four months. Simple example above (click image to zoom)  meets business needs but when we deploy our project to the server and try to verify data in SSMS we will see something unexpected:

1

Where is our Named Set?

Maybe we should write MDX DML query to retrieve some data from our dataset. We can use something like that:

But the result will be nothing or ( 0 rows and 0 columns) or only name of used measure.

1

When I try to check this in Excel the result was completely different:

1

Defined Named set was visible and can be used every time I want ( regardless it’s empty). It’s very interesting feature that every developer should know – some client tools try to hide named sets that are empty! Of course  if client tools (like SSMS)  hide object, it’s still accessible via pure MDX query.

If you want to check behavior of your client tool you can use the same mdx query with small modification:

1

Now, it could be used via GUI of SSMS because it’s not empty anymore. So sometimes our soft try to be nice for us and hide empty objects. Pretty cool!

Leave a Comment

Your email address will not be published. Required fields are marked *