Skip to Content
0
Jul 22 at 09:21 AM

How to join arrays and use the combined values as a filter for a chart widget?

37 Views

Hi all,

Is it possible to join 2 Arrays and use the combined values as a filter?

Requirement:

Create a bar chart displaying Top & Bottom 5 dimension values.

I have managed to filter the chart by the result set of either the Bottom 5 or Top 5 table - but can't work out how to
do both.
I currently use the code below in the button - it uses the result set from the Bottom 5 table and sets that as the chart filter.
Ideally I need it to filter the chart to 10 values (those from both tables)

var dims = Table_1.getDimensionsOnRows()[0];
var selections=Table_1.getDataSource().getDataSelections();
var memberIds = ArrayUtils.create(Type.string);
for (var i = 0; i < selections.length; i++)
{ var member = Table_1.getDataSource().getResultMember(dims, selections[i]); memberIds.push(member.id); } Chart_1.getDataSource().setDimensionFilter(dims,memberIds);

Attachments