Search code examples
databasemultidimensional-arrayparametersanylogic

Get name of dimensional array


I am currently trying to match a HyperArray parameter to the database.

I am trying to get the match the Dimension name to the database name. I am struggle to call/get the Dimension name. Does anyone have advise on how I could call the dimension name if I select Dimension 1.

Modules is a HyperArray Parameter

Database

Previous Assistance Received


Solution

  • as you know, a variable can have multiple dimensions, and each dimension can have multiple values, where each value is associated to a name.

    There are 2 indexes of importance, the first one is the one associated to the index of the dimension, let's call it dimIndex In your case there's only 1 dimension called Module_List so, dimIndex must be equal to 0

    The second one is the value of that dimension, in your case Module_List has values of Busman_113 and Busman_124

    Modules.getDimensions()[dimIndex].getIndexName(0) will be equal to "Busman_113" and Modules.getDimensions()[dimIndex].getIndexName(1) will be equal to "Busman_124"