BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
BSwid
Contributor

Graph Builder Bar Graph filter by top 10 Sums

I have a horizontal stacked bar graph and want to limit it to just the top 10 sums by Y-axis category.  

 

The data has a year's worth of customer orders.  Each row is an order line item that has a customer, a value and a customer country (among other data).  The x-axis is summary statistic sum of the order value.  The y-axis is the customer name.  And the stacking (overlay) is by the customer country. 

 

My goal is to not show all 1,000 customers, but rather just the top 10 by the total of their order values.
 

The script at the moment looks like this, where sales org. is the customer country

Graph Builder(
	Size( 905, 603 ),
	Variables(
		X( :Total Dollars Ordered ),
		Y(
			:Customer,
			Order By( :Total Dollars Ordered, Ascending, Order Statistic( "Sum" ) )
		),
		Overlay( :Sales Organization Code )
	),
	Elements(
		Bar( X, Y, Legend( 4 ), Bar Style( "Stacked" ), Summary Statistic( "Sum" ) )
	),
	SendToReport(
		Dispatch(
			{},
			"graph title",
			TextEditBox,
			{Set Text( "Total Dollars Ordered by Customer" )}
		)
	)
)

.

0 Kudos
2 REPLIES 2

Re: Graph Builder Bar Graph filter by top 10 Sums

You might create a new data column with the ranks. Then exclude and hide rows with ranks > 10.

Learn it once, use it forever!
0 Kudos
txnelson
Super User

Re: Graph Builder Bar Graph filter by top 10 Sums

This question has been previously asked and answered

Top 10 Sums

Jim
0 Kudos