Planning Analytics

Planning Analytics

Get AI-infused integrated business planning

 View Only
Expand all | Collapse all

MDX Subset Filtering on dimension members greater than or equal (>=)

  • 1.  MDX Subset Filtering on dimension members greater than or equal (>=)

    Posted Thu August 08, 2024 08:25 AM

    Hi all,

    I recently used the following MDX query to create a dynamic subset for a view in a TI process:

    MDX
    FILTER( TM1FILTERBYLEVEL(TM1SUBSETALL([Months].[Months]), 0), [Months].[Months].CURRENTMEMBER.NAME >= "07" )

    This query effectively filters leaf members in the [Months] dimension to include only those starting from "07" 

    This is a very simple, but helpful MDX, for example in case you want to create a dynamic view to zero out the rest of the year before you import new data to a cube. 

    I'd like to appeal to IBM to enhance the IBM Planning Analytics MDX documentation.

    Including real-world examples, such as filtering dimension members (e.g., months >= a specific value), would significantly improve the usability of the documentation.

    It is also worth mentioning the impact of multiple hierarchies on the MDX code.

    Thanks for considering this!



    ------------------------------
    Asgeir Thorgeirsson
    ------------------------------


  • 2.  RE: MDX Subset Filtering on dimension members greater than or equal (>=)

    Posted Thu August 08, 2024 08:29 AM

    Wim's site is here to save the day..



    ------------------------------
    George Tonkin
    Business Partner
    MCI Consultants
    Johannesburg
    ------------------------------



  • 3.  RE: MDX Subset Filtering on dimension members greater than or equal (>=)

    Posted Sun August 11, 2024 04:24 PM

    hi @Asgeir Thorgeirsson,

    The reason is because "07" is not a number, it is the name of the element JULIO, right?
    that means you can't use ">=" because it is a mathematical function (applies only to numbers).
    What you can do is:

    1. create a numeric attribute and fill it from 1 to 12;
    2. replace your statement with
      [Months].[Months].CURRENTMEMBER.PROPERTIES("new attribute") >= 7

    I hope it works,
    Regards,
    Martin



    ------------------------------
    Martin De Giovanni
    ------------------------------