none
Parent-child relationship.. Why is the count not coming out correct.

    Question

  • Hi

    Can someone please explain to me why is the final count coming to 903 and 896 in the following screen. It should be 2 as a total of two Ids. I have a parent-child relationship defined on Item Sample level. There are lots of other Item parent CHild Heirachies too, it looks like its putting the count from there. Need help with this as soon as possible.

    Thanks

    Saturday, July 06, 2013 8:38 AM

All replies

  • What is your Count expression?  Did you choose the correct fields to total?

    Ryan D

    Saturday, July 06, 2013 11:20 PM
  • Thanks much Ryan

    Let me explain from the beginning, I have a table like this and it has a join on my fact table with DCKey.

    Hence if  ParentKey 1 will be picked, DCKeys of 94 and 63680 will be selected and joined with Fact table. and say time that is needed is  4/5/2001 11:00 Then there is one reading for 94 and One reading for 63680 so for ParentKey 1 there should be 2 readings at 4/5/2001 11:00

    ParentKey, Key,       DCKey

    1           1              94
    1           164428   63680
    24           24         94
    24           241       63680
    24           242       63712
    24           243       88901

    Key column is the primary Key colum for my table and since its a parent CHild relations. It will look something like this

    ParentKey

    Key   ................................(Each Key has a DCkEY)

    Giving you an example of Parentkey 122559 here now, that should have a count of 2. Keeping in mind that 63680 DCKey is under parentKey  1 also and parentKey 24 also. But we only want 1 entry from 122559, which is underlined with a Key of 1225592

    122559 122559 94
    122559 1225591 63712
    122559 1225592 63680

    The dimension usage, dsv and results looks like this and you can see the results for grand total look different when seen in column vise and row vise. Not sure why.

    Thanks much

     and the mdx results are wrong too like this..

    Monday, July 08, 2013 8:09 PM
  • I need help with this asap.. Please
    Tuesday, July 09, 2013 11:41 PM
  • hi


    you may want to check if any of this addresses your problem. 

    http://vnu10.blogspot.com/2011/01/mdx-grand-total-sub-total.html

    you may also want to create a calculated measure. something like this

    case when  [Dim Name].[Level Name].currentmember is [Dim Name].[Level Name].[All] then

    sum(
           Descendants([Dim Name].[Level Name].CurrentMember,,LEAVES),
            [Measures].[MeasureName]); 

    else

     [Measures].[MeasureName]

    end



    vinu

    Wednesday, July 10, 2013 12:23 AM
  • Hi Vinu

    Thanks much for your help on this. Can you please explain what would this code do?

    case when  [Dim Name].[Level Name].currentmember is [Dim Name].[Level Name].[All] then

    sum(
           Descendants([Dim Name].[Level Name].CurrentMember,,LEAVES),
            [Measures].[MeasureName]); 

    else

     [Measures].[MeasureName]

    Thanks much

    -Sarah

    Monday, July 15, 2013 7:46 PM