locked
NONEMPTY and NON EMPTY issue RRS feed

  • Question

  • I'm not able to understand why NONEMPTY is behaving in the following way and not displaying any data.

    Please find the sample snapshot below:

    CASE I: Without the NON EMPTY or NONEMPTY where one row is available.

    CASE II: Using NON EMPTY on the ROWS still give the desired output.

    CASE III: However when using NONEMPTY on the ROWS, it is not populating any data at all.

    I'm not able to understand why the NONEMPTY is behaving this way. As per my understanding NONEMPTY() function that returns the set of tuples that are not empty from a specified set. However in the CASE I, you can see there are no such empty set returned. There is only one Row which has data. The NON EMPTY works as expected. But very strange for NONEMPTY.

    Kindly help me understand why and how can this be avoided as I have a very complex MDX code using NONEMPTY() function


    - Pratik
       Please use Marked as Answer if my post solved your problem and use Vote As Helpful if it was...

    Thursday, January 8, 2015 12:52 PM

Answers

  • Hi Pratik ,

    I can explain in my words, but it will be better to send you the next link

    http://beyondrelational.com/modules/2/blogs/65/posts/11569/mdx-non-empty-vs-nonempty.aspx

    Great explanations with examples from Jason's blog .


    Regards, David .

    Sunday, January 11, 2015 8:57 AM

All replies

  • They are different

    NON EMPTY is applied on the set to remove nulls whereas NONEMPTY function is to use to exclude empty tuples from resultset

    see

    http://beyondrelational.com/modules/2/blogs/65/posts/11569/mdx-non-empty-vs-nonempty.aspx


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Thursday, January 8, 2015 1:01 PM
  • Hi,

    Thanks for your reply.

    But if you will check the above screenshot, there are no null values when not using NON EMPTY or NONEMPTY (CASE I).

    But when using NON EMPTY, it is working as expected; but when using NONEMPTY it is removing non empty tuples.

    Thanks in advance,


    - Pratik
       Please use Marked as Answer if my post solved your problem and use Vote As Helpful if it was...

    Thursday, January 8, 2015 1:23 PM
  • Hi Pratik ,

    If you won't define the NONEMPTY the measure which will create tuple with months, it will take the default measure or the first one in your measure groups .

    Try  NONEMPTY([Time Production].[Month].&[2014-10], [Measures].[Factory Data]) 

    to see how it works with your example .


    Regards, David .

    Thursday, January 8, 2015 3:22 PM
  • Thanks a lot David, it really worked,...!!! :)

    But would you mind to elaborate a little because as per my understanding, the NONEMPTY and/ or NON EMPTY should remove only the null/ empty tuples.

    For example, if my normal output (CASE I) would have been:

    2014-10 |   8.0  | (null) | 99
    2014-10 | (null) | (null) | (null)

    then using NONEMPTY or NON EMPTY should remove the second tuple for which there are no measures value.

    Could you please explain a bit more?

    Regards,


    - Pratik
       Please use Marked as Answer if my post solved your problem and use Vote As Helpful if it was...

    Friday, January 9, 2015 6:37 AM
  • Hi Pratik ,

    I can explain in my words, but it will be better to send you the next link

    http://beyondrelational.com/modules/2/blogs/65/posts/11569/mdx-non-empty-vs-nonempty.aspx

    Great explanations with examples from Jason's blog .


    Regards, David .

    Sunday, January 11, 2015 8:57 AM