cancel
Showing results for 
Search instead for 
Did you mean: 

How to Fill Dropdown by Dimension Members of a Chart or Table in Analytic Applications

zamo02
Discoverer
0 Kudos

Hello all,

I am struggling with the population of my dropdown from a live connection with the members of a dimension. I got a "Kalenderjahr" Dimensions with Members e.x. "2020", "2021", etc. - I want to populate my Dropdown with this Members. 

My following code does not populate the dropdown by initialization of the canvas:

var i=0;
var Kalenderjahr = Table_1.getDataSource().getMembers("Kalenderjahr");
for(i=0; i < Kalenderjahr.length; i++)
{

Dropdown_1.addItem(Kalenderjahr[i].id);

}

As a result I want to have a Dropdown with which I can filter the Measure of the Workdays, but still I am not able to retrieve any Members in my Dropdown for selection. Anyone an idea why it is not working?

BR

 

Accepted Solutions (0)

Answers (2)

Answers (2)

eeddggaarr
Contributor
0 Kudos

Hi zamo02,

try this (replace dimension as needed):

var dimMembers = Table_1.getDataSource().getMembers("0CALYEAR");
for (var i = 0; i < dimMembers.length; i++) {
	Dropdown_1.addItem(dimMembers[i].id);
}

dimMembers is of type Memberinfo which means you have to specify if you would like id/description,... 

br
edgar

N1kh1l
Active Contributor
0 Kudos

@zamo02 

Can you console.log(Kalenderjahr); and see what is the output in the browser console.