Note that there are some explanatory texts on larger screens.

plurals
  1. POAggregation of an MDX calculated measure when multiple time periods are selected
    primarykey
    data
    text
    <p>In my SSAS cube, I've several measures defined in MDX which work fine except in one type of aggregation across time periods. Some don't aggregate (and aren't meant to) but one does aggregate but gives the wrong answers. I can see why, but not what to do to prevent it.</p> <p>The total highlighted in the Excel screenshot below (damn, not allowed to include an image, reverting to old-fashion table) is the simplest case of what goes wrong. In that example, 23,621 is <em>not</em> the grand total of 5,713 and 6,837.</p> <pre><code> Active Commitments Acquisitions Net Lost Commitments Growth in Commitments 2009 88,526 13,185 5,713 7,472 2010 92,125 10,436 6,837 3,599 Total 23,621 23,621 </code></pre> <ol> <li>Active Commitments works fine. It is calculated for a point in time and should not be aggregated across time periods.</li> <li>Acquisitions works fine.</li> <li><code>[Measures].[Growth in Commitments] = ([Measures].[Active Commitments],[Date Dimension].[Fiscal Year Hierarchy].currentMember) - ([Measures].[Active Commitments],[Date Dimension].[Fiscal Year Hierarchy].prevMember)</code></li> <li><code>[Measures].[Net Lost Commitments] = ([Measures].[Acquisitions] - [Measures].[Growth in Commitments])</code></li> </ol> <p>What's happening in the screenshot is that the total of Net Lost Commitments is calculated from the total of Acquisitions (23,621) minus the total of Growth in Commitments (which is null).</p> <p>Aggregation of Net Lost Commitments makes sense and works for non-time dimensions. But I want it to show null when multiple time periods are selected rather than an erroneous value. Note that this is not the same as simply disabling all aggregation on the time dimension. The aggregation of Net Lost Commitment works fine up the time hierarchy -- the screenshot shows correct values for 2009 and 2010, and if you expand to quarters or months you still get correct values. It is only when multiple time periods are selected that the aggregation fails.</p> <p>So my question is how to change the definition of Net Lost Commitments so that it does not aggregate when multiple time periods are selected, but continues to aggregate across all other dimensions? For instance, is there a way of writing in MDX:</p> <pre><code>CREATE MEMBER CURRENTCUBE.[Measures].[Net Lost Commitments] AS (iif([Date Dimension].[Fiscal Year Hierarchy].**MultipleMembersSelected** , null , [Measures].[Acquisitions] - [Measures].[Growth in Commitments])) </code></pre> <p>ADVthanksANCE,</p> <p>Matt.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload