Planning Analytics

Planning Analytics

Get AI-infused integrated business planning

 View Only
  • 1.  Update dimensions using TM1 REST API

    Posted Mon December 09, 2024 04:40 PM

    Hi all,


    We can create dimension elements and edges using the following POST requests:
    /api/v1/Dimensions('dimName')/Hierarchies('hierName')/Elements
    /api/v1/Dimensions('dimName')/Hierarchies('hierName')/Edges

    Since those endpoints do not accept PATCH requests, how can we update the existing dimensions (elements and hierarchies) using the REST API?



    ------------------------------
    Vlad Didenko
    Founder at Succeedium
    TeamOne Google Sheets add-on for IBM Planning Analytics / TM1
    https://succeedium.com/teamone/
    Succeedium Planning Analytics Cloud Extension
    https://succeedium.com/space/
    ------------------------------


  • 2.  RE: Update dimensions using TM1 REST API

    Posted Tue December 10, 2024 12:59 AM
    I believe you still use a POST. For adding an element it would go into the json body. I’m not an expert here but you could also take a look at TM1py to get a sense for how they have implemented functions like adding an element using python to call the rest api.


    Robby
    Details about the personal data CBRE collects and why, as well as your data privacy rights under applicable law, are available at CBRE – Privacy Policy.<https: www.cbre.com about privacy-policy policy-picker>




  • 3.  RE: Update dimensions using TM1 REST API

    Posted Tue December 10, 2024 01:58 AM

    Thanks @Robby Meyers! I appreciate your input. However, my goal is to update the entire dimension/hierarchy, not just add new elements.

    From what I understand, the appropriate approach might be to use the PATCH /api/v1/Dimensions('dimName')/Hierarchies('hierName') request, but I wanted to confirm if this is the correct way.



    ------------------------------
    Vlad Didenko
    Founder at Succeedium
    TeamOne Google Sheets add-on for IBM Planning Analytics / TM1
    https://succeedium.com/teamone/
    Succeedium Planning Analytics Cloud Extension
    https://succeedium.com/space/
    ------------------------------



  • 4.  RE: Update dimensions using TM1 REST API

    Posted Tue December 10, 2024 05:35 AM

    It should be possible to provide an array of new elements via a single POST request, so it really depends what you want/ need to do,

    For reference IBM docs list: https://www.ibm.com/docs/en/planning-analytics/2.0.0?topic=data-elements

    POST ~/api/v1/Dimensions/tm1.subList()
    {"Keys":["Customers","Products","Non-Existing-Dimension",{"Name":"Customers"},"T i M e "]}



    ------------------------------
    Edward Stuart
    Solutions Director
    Spitfire Analytics Limited
    Manchester
    ------------------------------



  • 5.  RE: Update dimensions using TM1 REST API

    Posted Tue December 10, 2024 11:06 AM

    If I recall correctly, I think you need to patch the Hierarchies path directly rather than those properties.

    https://github.com/cubewise-code/tm1py/blob/dbf68d42d3ef752aa050545a4ba2adda4cdf3632/TM1py/Services/HierarchyService.py#L120



    ------------------------------
    Ryan Clapp
    ------------------------------



  • 6.  RE: Update dimensions using TM1 REST API

    Posted Tue December 10, 2024 01:59 PM

    Thanks @Edward Stuart, my intention was to update the entire dimension including the existing elements.

    Thanks @Ryan Clapp, yes this is extactly what I tired yesterday and it worked!

    The issue is resolved now:

    PATCH /api/v1/Dimensions('dimName')/Hierarchies('hierName')



    ------------------------------
    Vlad Didenko
    Founder at Succeedium
    TeamOne Google Sheets add-on for IBM Planning Analytics / TM1
    https://succeedium.com/teamone/
    Succeedium Planning Analytics Cloud Extension
    https://succeedium.com/space/Vlad Didenko
    Founder at Succeedium
    TeamOne Google Sheets add-on for IBM Planning Analytics / TM1
    https://succeedium.com/teamone/
    Succeedium Planning Analytics Cloud Extension
    https://succeedium.com/space/
    ------------------------------