We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Is it possible to retrieve all hierarchy levels through API?

Answered
davide dimola asked on July 11, 2019

Hi,
 
I've this dimension defined in my mondrian 4 xml file:
 
<Dimension name='Customers' table='USERS' key='customer_id'>
<Attributes>
<Attribute name='state' keyColumn='STATE' hasHierarchy='false' />
<Attribute name='customer_id' keyColumn='ID' nameColumn='NAME' hasHierarchy='false'/>
</Attributes>
<Hierarchies>
<Hierarchy name='state'>
<Level attribute='state' uniqueMembers='false'/>
<Level attribute='customer_id'/>
</Hierarchy>
</Hierarchies>
</Dimension>
 
I need to retrieve somehow the two levels "state" and "customer_id" (from the UI point of view the same highlighted in yellow in the attached screenshot), but i cant find any API to achieve this.
 
Am I missing something? Is there any API to retrieve this kind of data?
 
Thanks,
Davide

Attachments:
Hierarchy_levels.JPG

7 answers

Public
Vera Didenko Vera Didenko Flexmonster July 12, 2019

Hello, 
 
Thank you for your question.
 
Could you please provide more details on your use case so that our team can suggest the best approach for your case?
 
We are looking forward to hearing from you.
 
Best Regards,
Vera

Public
davide dimola July 12, 2019

Sure:
 
the modal used to set colums, rows and measure does not fit with our company UI guidelines, so I'm trying to move out the configuration of the pivot table to the same "UI level" of the pivot table itself.
For a more detailed view please check the image in the attachment (sorry for the really bad quality).
 
Is that clear enought?
 
Thanks,
Davide

Attachments:
USE_CASE.png

Public
Tanya Gryshko Tanya Gryshko Flexmonster July 15, 2019

Hello, Davide,

Thank you for your quick reply and for providing more details.

We would like to inform you that it is possible to configure the Field List to be shown on the right instead of the pop-up window. Please consider the following example: https://jsfiddle.net/flexmonster/qmLuesxw/. Does it work for you?
Also, some additional CSS styles might be applied to the Field List. For example, here is a compact Field List: https://jsfiddle.net/flexmonster/rknvL123/.

In case you prefer to create your own Field List, we could extend getAllHierarchies() to return information about the hierarchy levels. Please let us know if this option seems more promising to you.

Regards,
Tanya

Public
davide dimola July 16, 2019

Hi Tanya,
 
thanks for the support, the shown example with the modal on the right is quite usefull.
But we'll prefer a more "programmatic" way in order to make component separation possibile  on component oriented frameworks like React (which our company is using) and Angular.
If FlexMonster team is going to implement this feature, is there any approximate release date?
 
Thanks,
Davide

Public
Tanya Gryshko Tanya Gryshko Flexmonster July 16, 2019

Hello, Davide,

Thank you for your answer.

Our development team will extend getAllHierarchies() to return information about the hierarchy levels and release this update on the 12th of August.

Please let us know in case of other questions.

Regards,
Tanya

Public
Vera Didenko Vera Didenko Flexmonster August 15, 2019

Hello, Davide,
 
 
We are pleased to inform you that now getAllHierarchies() API call returns a list of levels if they are available.
Here is an example for illustration: http://jsfiddle.net/flexmonster/ux5kcsf9/
 
This is provided in the 2.7.12 version of Flexmonster: https://www.flexmonster.com/release-notes/
 
You are welcome to update the component: https://www.flexmonster.com/doc/updating-to-the-latest-version/
 
 
Please let us know if everything works fine for you.
 
Best Regards,
Vera

Public
davide dimola August 19, 2019

Great,
 
thanks for the quick support.
 
Davide

Please login or Register to Submit Answer