KPI in WPF Olap Grid
6 May 20213 minutes to read
KPI is a collection of calculations that are associated with a measure group in a cube that are used to evaluate business success. Typically, these calculations are a combination of multi-dimensional expressions (MDX) or calculated members. KPIs also have additional metadata that provides information about how grid applications should display the results of KPI calculations.
The following are the different types of indicators:
- KPI goal
- KPI status
- KPI trend
- KPI value
/// <summary>
/// OlapReport with KPI Elements
/// </summary>
/// <returns></returns>
private OlapReport LoadBasicKPI()
{
OlapReport olapReport = new OlapReport();
// Selecting the Cube
olapReport.CurrentCubeName = "Adventure Works";
KpiElements kpiElement = new KpiElements();
// Specifying the KPI Element name and configuring its Indicators
kpiElement.Elements.Add(new KpiElement
{
Name = "Internet Revenue",
ShowKPIGoal = true,
ShowKPIStatus = true,
ShowKPIValue = true,
ShowKPITrend = true
});
DimensionElement dimensionElementRow = new DimensionElement();
// Specifying the Name for Row Dimension Element
dimensionElementRow.Name = "Date";
// Specifying the Level element
dimensionElementRow.AddLevel("Fiscal", "Fiscal Year");
// Adding Row Elements
olapReport.SeriesElements.Add(dimensionElementRow);
// Adding Column Elements
olapReport.CategoricalElements.Add(kpiElement);
return olapReport;
}
''' <summary>
''' OlapReport with KPI Elements
''' </summary>
''' <returns></returns>
Private Function LoadBasicKPI() As OlapReport
Dim olapReport As OlapReport = New OlapReport()
olapReport.CurrentCubeName = "Adventure Works"
Dim kpiElement As KpiElements = New KpiElements()
kpiElement.Elements.Add(New KpiElement With {.Name = "Internet Revenue", .ShowKPIGoal = True, .ShowKPIStatus = True, .ShowKPIValue = True, .ShowKPITrend = True})
Dim dimensionElementRow As DimensionElement = New DimensionElement()
dimensionElementRow.Name = "Date"
dimensionElementRow.AddLevel("Fiscal", "Fiscal Year")
olapReport.SeriesElements.Add(dimensionElementRow)
olapReport.CategoricalElements.Add(kpiElement)
Return olapReport
End Function
A sample demo is available in the following location.
{system drive}:\Users\<User Name>\AppData\Local\Syncfusion\EssentialStudio\<Version Number>\WPF\OlapGrid.WPF\Samples\Product Showcase\KPI