How to Script Unique Name of Hierarchy and Change it Dynamically

Hi guys :slight_smile:

I wonder if anyone can help me to create a script example for the following.


I have created the following table with customized bins that can be changed dynamically by the user

Bin size:

I made the bins as hiearchies in the cube by using data input, so that the users can dynamically change the bin sizes in the dashboard.

I want to create a script where the unique name of the bin hierarchie (Bin 1-5 in this example) can dynamically change based on what the user enter as bin value in the dashboard.

In this example i want to change the hierarchy value name in the table from Bin 1 --> Bin 1: 1-19, for instance, and so on for the rest of the bins.

Does anyone know how I can script this so the hierarchy naming is changing dynamically? And if yes, can anyone help me with an example? I am a bit stuck…

I have tried to use HierarchyService’s getHierarchyById method to get the hierarchy you want without any success.


I’m not sure if you need to change the hierarchy itself which is complicated, or if would be enough for you to change the row label in the table which is less complicated but still not simple.

I had an issue with the hierarchies not that long ago, and I learnt that even if you set “no cache” in the DataCube that feeds it, the hierarchy is only reloaded each 20 minutes by default, you can reduce this in the settings, BUT it will affect all the hierarchies, not this one only, and your dashboards will begin to have weird behaviours… Therefore the hierarchy approach might not be the correct one. You can try by setting a Bridge Parameter that you’ll use as value in the DataCube query.

Hi @david.glickman & @romero.olivier. Thanks for the feedback :slight_smile: Will have a look at it and see if am able to solve it