none
Exception of type 'System.OutOfMemoryException' was thrown.

    Domanda

  • when i run :

    with member [Measures].[Number of Emps] as  count(nonempty({[D TC Employee].[Name].members},{[Measures].[F TC Count]}))
     
     select {[Measures].[Number of Emps]} on 0,
     NON EMPTY{[D TC Entity].[Parent Entity Id].[Level 02].members}*{[D Services].[Service Description].members} on 1
     from [TC Cube]
    i got :
    Executing the query ...
    Exception of type 'System.OutOfMemoryException' was thrown.
    Execution complete

    can anybody rewrite the query to solve the problem?

    sabato 1 dicembre 2012 09:15

Risposte

Tutte le risposte

  • MDX looks fine to me.

    For you to convince try this, sames as your query runs without any issue. Check your system memory I think number of records in your cube is more, try putting filter and narrow the scope (for testing purpose)

    WITH MEMBER [Measures].[Employee Count] AS
     COUNT( NonEmpty( { [Employee].[Employee].[Employee].Members }, (  [Measures].[Order Count] ) ) )
    SELECT
     {
      [Measures].[Employee Count]
     } ON COLUMNS,
     NON EMPTY ({[Department].[Departments].[Department Level 01].members}*{[Geography].[Geography].[City].members}
     ) ON ROWS
    FROM
     [Adventure Works]

    sabato 1 dicembre 2012 13:49
  • on another forum, someone advised to changed "NON EMPTY" to "NONEMPTY" (the first with space and the second without), and it worked find and fast.

    anybody can explain what happened ?!

    • Contrassegnato come risposta Butmah sabato 8 dicembre 2012 09:17
    domenica 2 dicembre 2012 06:59
  • I agree NON EMPTY is memory intensive operation. Choice between NON EMPTY and NONEMPTY depends on what outcome you expect from the MDX. NONEMPTY works only on axis and works on the current scope. Where as NON EMPTY is can be used anywhere and it does not take into account the current scope. The MDX outcome from both are not same. 

    Depending on what you need you can decide which one to go for. For cross product you can narrow the scope by using NONEMPTY function that is what I said in my first post filter and narrow the scope.
    Also read this article:  http://sqldusty.wordpress.com/2012/08/10/non-empty-vs-nonempty-to-the-death
    domenica 2 dicembre 2012 10:42
  • i assume the number of members on level 02 and service description are huge. non empty will filter nothing, as count always gives back a number. you might want to rewrite your calculation to give back NULL where the count is 0 (using an iif). doing so, the actual result set returned will be smaller. if it does not solve the problem, i recommend to pre-filter the set on the axis, if you can. maybe the ([F TC Count], [D TC Employee].[...].[All] ) will be always 0 when the count is 0?
    lunedì 3 dicembre 2012 09:56
  • on another forum, someone advised to changed "NON EMPTY" to "NONEMPTY" (the first with space and the second without), and it worked find and fast.

    anybody can explain what happened ?!

    Hi butmah,

    You can refer to the following article about different between NON EMPTY() and NONEMPTY():
    MDX : Non Empty v/s NonEmpty: http://beyondrelational.com/modules/2/blogs/65/posts/11569/mdx-non-empty-vs-nonempty.aspx

    Regards,


    Elvis Long
    TechNet Community Support

    • Contrassegnato come risposta Butmah sabato 8 dicembre 2012 03:46
    giovedì 6 dicembre 2012 09:30