question

venkat505 avatar image
venkat505 asked

difference between nonempty and where clause in mdx

Hi, This may be very basic question. What is the difference between NONEMPTY and WHERE clause. If you see the below 2 mdx queries. Query1 select {[Labor_Periods].[Total Year].[Qtr1].[Apr], [Labor_Periods].[Total Year].[Qtr1]. [May]} on 0, non empty([Labor_Employees].allmembers) on 1 from [Cube] where ([LABOR_VERSION].[FCST-CURR]) Query2 select {[Labor_Periods].[Total Year].[Qtr1].[Apr],[Labor_Periods].[Total Year].[Qtr1].[May]} on 0, NONEMPTY([Labor_Employees].allmembers,[LABOR_VERSION].[FCST-CURR]) on 1 from [Labor] Above 2 queries will give the same result. Is both NONEMPTY and WHERE serve the same purpose in the above query context or will there be any difference.
ssisssasmdx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rob Farley avatar image
Rob Farley answered
It's not so much that WHERE and NONEMPTY are the same, it's about the fact that both queries are slicing by FCST-CURR. In one query you have it in the Slicer axis (the WHERE clause). In the other it's in Axis 1. There are plenty of axes you can slice with, of course. Remember you have NONEMPTY in both queries - what you're seeing is more about the general concept of slicing cubes, which happens pretty much the same, whichever sides of the cube you choose to approach with the knife.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

venkat505 avatar image
venkat505 answered
Thanks Rob
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.