Articles in this section
Category / Section

How to select top "n" records from cube in WPF OlapGrid?

1 min read

In WPF OlapGrid, you can select the top "n" records from the Cube by using TopCountElement in OlapReport.


OlapReport olapReport = new OlapReport();olapReport.Name = "Customer Report";olapReport.CurrentCubeName = "Adventure Works"; DimensionElement dimensionElementColumn = new DimensionElement();//Specifying the Name for the Dimension ElementdimensionElementColumn.Name = "Customer";dimensionElementColumn.AddLevel("Customer Geography", "Country"); //Creating Measure ElementMeasureElements measureElementColumn = new MeasureElements();measureElementColumn.Elements.Add(new MeasureElement { Name =
"Internet Sales Amount" }); DimensionElement dimensionElementRow = new DimensionElement();//Specifying the Dimension NamedimensionElementRow.Name = "Date";dimensionElementRow.AddLevel("Fiscal", "Fiscal Year"); //Filter the top 5 elements of "Internet Sales Amount".TopCountElement topCountElement = new
TopCountElement(AxisPosition.Categorical, 5);topCountElement.MeasureName = "Internet Sales Amount"; /// Adding Column MembersolapReport.CategoricalElements.Add(dimensionElementColumn);///Adding Measure ElementolapReport.CategoricalElements.Add(measureElementColumn);///Adding Measure ElementolapReport.CategoricalElements.Add(topCountElement);///Adding Row MembersolapReport.SeriesElements.Add(dimensionElementRow);


Dim olapReport As OlapReport = New OlapReport()
olapReport.Name = "Customer Report"
olapReport.CurrentCubeName = "Adventure Works"
Dim dimensionElementColumn As DimensionElement = New DimensionElement()
'Specifying the Name for the Dimension Element
dimensionElementColumn.Name = "Customer"
dimensionElementColumn.AddLevel("Customer Geography", "Country")
'Creating Measure Element
Dim measureElementColumn As MeasureElements = New MeasureElements()
measureElementColumn.Elements.Add(New MeasureElement With {.Name = "Internet Sales Amount"})
Dim dimensionElementRow As DimensionElement = New DimensionElement()
'Specifying the Dimension Name
dimensionElementRow.Name = "Date"
dimensionElementRow.AddLevel("Fiscal", "Fiscal Year")
'Filter the top 5 elements of "Internet Sales Amount".
Dim topCountElement As TopCountElement = New TopCountElement(AxisPosition.Categorical, 5)
topCountElement.MeasureName = "Internet Sales Amount"
''' Adding Column Members
'''Adding Measure Element
'''Adding Measure Element
'''Adding Row Members



I hope you enjoyed learning about how to select top "n" records from Cube in OlapGrid.

You can refer to our WPF OlapGrid feature tour page to know about its other groundbreaking feature representations. You can also explore our WPF OlapGrid documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment