This example shows how to display sales by years in comparison with the previous year's sales.
The Previous Year Sales Grid displays sales by year in comparison with the previous year’s sales. The PrevYearSales field is calculated by the following expression:
aggr(Sum([Sales]), joinRule(GetYear([OrderDate]),GetYear([OrderDate])-1))
The joinRule function here is used to shift the calculated sales back a year. Add the created field to the Grid’s Columns section to see the result:
The second Grid, Product Sales by Quarters, displays quarterly sales numbers in comparison with corresponding quarterly numbers from the previous year.
The PrevQuarterYearSales calculated field aggregates sales by products and the previous year’s quarter. The joinRule function is used to calculate the second dimension.
aggr(Sum([Sales]),[ProductName],joinRule(GetDateQuarterYear([OrderDate]),GetDateQuarterYear(AddYears([OrderDate], -1))))
A format rule is applied to highlight sales that declined in comparison to the previous year:
- Dashboard for WinForms - How to display best and worst monthly sales for each year
- Dashboard for WinForms - How to Calculate the Contribution of Quarterly Sales to Total Yearly Sales
- Dashboard for WinForms - How to evaluate a customer acquisition using the quarter/year of their first purchase
- Dashboard for WinForms - How to divide customers' count by the number of orders they made
- Dashboard for WinForms - How to calculate Highest Product Sales by Year
- Dashboard for WinForms - How to Display Product Sales that are Greater than $20k
- Dashboard for WinForms - How to Display Products with Sales Greater than Average Sales per Category
(you will be redirected to DevExpress.com to submit your response)