cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic measure in charts using same data source

arijit_das
Active Contributor
0 Kudos

Hi Experts,

I am trying to use single data source to show chart for selective measures. I have tried the steps here: . Here we can create multiple charts with selective measures using single data source.

But, is it possible to re-use the same chart component ? I mean, selecting a measure name from a drop down, I want to change the measure in the same chart component - using one chart component and one data source. Is it possible using some script ?

I tried but could not find an option for a chart component to change the dimension/measure. I do not want to have one chart for each measure and show/hide based on the selection. I want a single chart and want to change the objects dynamically using some script.

Regards,

Arijit

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Arijit,

  1. For Changing the measures in your chart - you can use CHART_1.setDataSelection() - Using this you can change measures in your chart
  2. For changing the dimensions however you have to change the Data Source state associated with the chart. You can use various script option to change the dimensions in rows and columns in your data source.

Hope this helps.

Regards,

arijit_das
Active Contributor
0 Kudos

Thanks Anil.

1. Any example how to use this function ? It accepts ResultSetSelection as a parameter. How to pass a measure to this function ?

2. Any sample script to change the initial view of a data source dynamically ?

Regards,

Arijit

Former Member
0 Kudos

Hi Arijit,

Say, if your chart is CHART_1, and you have linked DS_1 with this chart as data source

1. CHART_1.setDataSelection({"KeyFigure Structure" : "measure1"});

Use Enterprise ID of elements as available Query Properties in Bex Query Designer, the DS however will provide you the value help anyway.

In case of multiple measures required in the Chart , you can use an array for restricting measures

CHART_1.setDataSelection({"KeyFigure Structure" : [ "measure1", "measure2"]});

2. If you would like to change the Axis- dimensions in your chart,

DS_1.moveDimensionToRows("new characteristic", 0)

This will replace the existing dimension in your chart and replace with new one.

Hope this helps.

Regards,

  

arijit_das
Active Contributor
0 Kudos

Works great !!! Thanks a lot Anil.

0 Kudos

Thanks Anil,

This works with charts fine.

but am trying with crosstab component its not working means that setDataSelection function not available for crosstab component.

can u please help me on this situation.

Former Member
0 Kudos

In such case, you have to change the data source using available APIs. Please use the corresponding APIs which change the rows and columns navigation of the CROSSTAB data source.

Regards

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

This message was moderated.

Answers (1)

Answers (1)

Arjun_KT
Participant
0 Kudos

Thank You Anil,

Its really helped

Regards

Arjun KT