Skip to Content
0

Top 10 and the remaining Items in a pie chart

Nov 14, 2017 at 01:50 PM

164

avatar image

Hi All,

I am trying implement a pie chart that shows top 10 Items and the remaining items grouped as others in the same chart. I understand it can be done for a chart (there is an option in its property)

But My dashboard is in UI5 M mode. hence there is no Chart component. and i am using infochart component. and i don't see any such option for infochart.

Do i have to manually find out the top 10 and the remaining Items and use it in Infochart.

Is there any easy option for it in Infochart as well.

I am using Bex query. Its not possible to implement top and group the remaining as others in the same query.

Please share some ideas.

Swapna

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Tammy Powlas
Nov 14, 2017 at 01:53 PM
0
Show 1 Share
10 |10000 characters needed characters left characters exceeded

HI Tammy,

Thanks for your reply.

The Approach mentioned by you only shows the top N values.

However my requirement is to have the Top 10 and the remaining Items as "Others" in a Pie chart.

Please provide your suggestions.

Thanks.

0
Mustafa Bensan Nov 15, 2017 at 08:30 AM
0

Hi Swapna,

The technique described in the following post should address your requirement:

https://blogs.sap.com/2015/08/14/how-to-visualize-others-in-sap-businessobjects-design-studio/

Regards,

Mustafa.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

HI Mustafa,

Thanks for the inputs. I tried with the approach mentioned in link.

The approach works fine on the start up of the dashboard.

later if i change the filter it not working.

Example. On startup event of dashboard i have set the filter to filter say PLANT=7080.

i have some filters in the dashboard which the user can change and view the data.

So every time user changes the PLANT to some value. the code should find out the top 10 and the rest for the selected plant.

in On select event of Plant filter i am writing the same code which i used in the start up to get result from final query. But its not working could you please share some ideas,

With the below code, I can the top 10 query results are changed according to filter. BUt the same are not passed to the next query to find out "Other"

DS_2.setVariableValue("DCVTUMPL", PLANT.getSelectedValue());
DS_3.loadDataSource();
var topcustomers=DS_2.getMembers("ZMATERIAL", 10);

topcustomers.forEach(function(element, index) {

if(index==0)
{
APPLICATION.setVariableValue("ZZMATOUO1", element.internalKey);
}
if(index==1)
{
APPLICATION.setVariableValue("ZZMATOUO2", element.internalKey);
}
if(index==2)
{
APPLICATION.setVariableValue("ZZMATOUO3", element.internalKey);
}
if(index==3)
{
APPLICATION.setVariableValue("ZZMATOUO4", element.internalKey);
}
if(index==4)
{
APPLICATION.setVariableValue("ZZMATOUO5", element.internalKey);
}
if(index==5)
{
APPLICATION.setVariableValue("ZZMATOUO6", element.internalKey);
}
if(index==6)
{
APPLICATION.setVariableValue("ZZMATOUO7", element.internalKey);
}
if(index==7)
{
APPLICATION.setVariableValue("ZZMATOUO8", element.internalKey);
}
if(index==8)
{
APPLICATION.setVariableValue("ZZMATOUO9", element.internalKey);
}
if(index==9)
{
APPLICATION.setVariableValue("ZZMATOUO11", element.internalKey);
}
});

0