This post is in continuation to my MDX techniques series. To continue further, it is important to understand the difference between NonEmpty() function and NON EMPTY keyword as we would be using them a lot in the future.
Both the NonEmpty() function and NON EMPTY keyword are used to reduce sets but they do it in completely different ways.
The NON EMPTY keyword removes empty rows or columns or both, depending on the axis on which it is used in the query. This means three things:
The NonEmpty() function on the contrary can be used anywhere in the query. The NonEmpty() function removes all the members from its first set where the value of one or more measures in the second set is empty. If there is no measure specified, the function is evaluated in the context of the current member. This means that the NonEmpty() function is highly dependent on the members in the second set, the slicer or the current co-ordinate.
Hope this clarifies the distinction between the two available ways of reducing result sets.