Planning Analytics

Planning Analytics

Get AI-infused integrated business planning

 View Only
  • 1.  How to get top parent of an element MDX

    Posted Wed November 02, 2022 12:54 PM
    Edited by System Admin Fri January 20, 2023 04:48 PM
      |   view attached
    Problem solved ! it should be .CURRENTMEMBER.Parent.Name

    Hi community, 

    I want to get top parent of an element in MDX and i get this #error (recursion)

    Can someone help to understand why and how i can fix it?

    My code : WITH MEMBER [FG_Mois].[FG_Mois].[TOTAL_ANNEE].[Societe] AS [FG_Section].[FG_Section].CURRENTMEMBER.Parent

    Any help will be appreciated!

    Best regard!

    ------------------------------
    Duong DAU
    Consultant EPM Finance Transformation & Performance - Micropole


    M +33 (0)7 62 61 85 33
    F +33 (0) 4 26 99 60 81
    131 Boulevard Stalingrad / 69100 Villeurbanne
    ------------------------------
    #PlanningAnalyticswithWatson


  • 2.  RE: How to get top parent of an element MDX

    Posted Fri November 04, 2022 05:27 AM
    You could write the top parent into an attribute and use the code I gave you previously to pull it out?

    Does the dimension change frequently?

    ------------------------------
    James McCarthy
    ------------------------------



  • 3.  RE: How to get top parent of an element MDX

    Posted Sat November 05, 2022 02:14 AM
    Thanks James for help, it worked !!

    ------------------------------
    Duong DAU
    Consultant EPM Finance Transformation & Performance - Micropole


    M +33 (0)7 62 61 85 33
    F +33 (0) 4 26 99 60 81
    131 Boulevard Stalingrad / 69100 Villeurbanne
    ------------------------------



  • 4.  RE: How to get top parent of an element MDX

    Posted Mon November 07, 2022 04:55 AM

    Instead of maintaining an extra attribute (unless you happen to have it already), you could simply use the MDX function Ancestor in this case as well as something like:

    WITH MEMBER [FG_Mois].[FG_Mois].[TOTAL_ANNEE].[Societe] AS ANCESTOR([FG_Section].[FG_Section].CURRENTMEMBER, [FG_Section].[FG_Section].[Level000]).NAME



    ------------------------------
    Hubert Heijkers
    ------------------------------



  • 5.  RE: How to get top parent of an element MDX

    Posted Mon November 07, 2022 05:08 PM
    Thank a lot Hubert, it worked perfectly :D

    ------------------------------
    Duong DAU
    Consultant EPM Finance Transformation & Performance - Micropole


    M +33 (0)7 62 61 85 33
    F +33 (0) 4 26 99 60 81
    131 Boulevard Stalingrad / 69100 Villeurbanne
    ------------------------------