Skip to content

This example demonstrates how to show the products with top N sales by category.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/winforms-dashboard-w-function-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files to look at:

Dashboard for WinForms - How to Use the W Function to Show Top N Products by Category

This example demonstrates how to show the products with top N sales by category.

The dashboard contains calculated fields with the following expressions:

Field Expression
ProductRankInCategory aggr(w(RankDense(Sum([ProductSales]), 'desc'), PartitionBy([CategoryName]), OrderBy()), [CategoryName], [ProductName])

The grid shows the products with the ProductRankInCategory value that is more or equal to the parameter value (default value is 2).

Grid rows in the Top Products and OTHERS are sorted by the TopNProductsSortOrder calculated field for proper arrangement.

Documentation

More Examples