Home Forums Data Warehousing Analysis Services Different aggreation results with and without a dummy WITH clause RE: Different aggreation results with and without a dummy WITH clause

  • OK, I tried this (a slight variation on your suggestion):

    WITH

    member [Measures].[Net Lost Commitments TEST ISERROR] as

    'iif(iserror([Date Dimension].[Fiscal Year Hierarchy].CurrentMember)

    , 1

    , 0)'

    member [Measures].[Net Lost Commitments TEST CALC] as

    '[Measures].[Acquisitions (during period)] - [Measures].[Growth in Commitments (during period)]'

    select

    {[Measures].[Acquisitions (during period)]

    ,[Measures].[Growth in Commitments (during period)]

    ,[Measures].[Net Lost Commitments TEST ISERROR]

    ,[Measures].[Net Lost Commitments TEST CALC]

    ,[Measures].[Net Lost Commitments (during period)]

    } on columns

    , {[Date Dimension].[Fiscal Year].[Fiscal Year].[2004\05],[Date Dimension].[Fiscal Year].[Fiscal Year].[2005\06]} on rows

    from Compass3

    ... with this result ...

    Acquisitions (during period)Growth in Commitments (during period)Net Lost Commitments TEST ISERRORNet Lost Commitments TEST CALCNet Lost Commitments (during period)

    2004\05 14,480 10,428 0 4,052 4,052

    2005\06 19,175 14,392 0 4,783 4,783

    All those numbers seem correct to me. You'll notice that the value coming from the cube for "Net Lost Commitments (during period)" is no longer null: as I mentioned in the initial post, that occurs any time I add *any* WITH clause.

    With regard to checking backwards through the values on which [Net Lost Commitments (during period)] depends, I have not been able to find any errors or missing values. [Acquisitions (during period)] and [Growth in Commitments (during period)] are themselves calculated measures, but both they and their constituents always have correct values.

    What's more I have a [Measures].[Net Lost Commitments (during previous period)] defined as:

    [Measures].[Net Lost Commitments (during period)],[Date Dimension].[Fiscal Year Hierarchy].prevMember

    So how's this for weird ...

    select

    {[Measures].[Net Lost Commitments (during period)]

    ,[Measures].[Net Lost Commitments (during previous period)]

    } on columns

    , {[Date Dimension].[Fiscal Year].[Fiscal Year].[2004\05],[Date Dimension].[Fiscal Year].[Fiscal Year].[2005\06]} on rows

    from Compass3

    Net Lost Commitments (during period)Net Lost Commitments (during previous period)

    2004\05 (null) 3,255

    2005\06 4,783 4,052

    So Net Lost Commitments (during previous period) for [Fiscal Year].[2005\06] is the correct value of 4,052 even though the value it depends on is shown as null!!!

    As you mentioned, the example I give is from [Fiscal Year] and I do also have a [Calendar Year]. I get similar problems with the calendar year hierarchy. At the moment, no [Calendar Year] returns null, by [Calendar Month].[Dec-2006] does return null. Both Fiscal and Calendar hierarchies seem to function 100% OK for all other measures.