Skip to content

DevExpress-Examples/winforms-dashboard-calculate-fiscal-functions-for-date-time-data-fields

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Files to look at:

Dashboard for WinForms - How to Calculate Fiscal Functions for Date-Time Data Fields.

This example shows how to find the number of a fiscal year, quarter, and week for date-time data fields.

Overview

In this example, the Grid dashboard item displays the fiscal year, quarter and week for the corresponding date.

SalesDynamics

The following expressions calculate fiscal values for the corresponding date:

Calculated Field Expression
Fiscal Year GetFiscalYear([OrderDate])
Fiscal Quarter GetFiscalQuarter([OrderDate])
Fiscal Week of Year GetFiscalWeekOfYear([OrderDate])

Example Structure

All Fiscal methods extend GetFiscalDateFunction and override the GetFiscal method used to calculate fiscal values.

Fiscal Year Function

Returns the year of input DateTime if it comes before a new fiscal year beginning date; otherwise returns the year plus 1.

Fiscal Quarter Function

If the diference between the input DateTime month and the startMonth field is not divisible by 3, the GetFiscal method returns the whole fraction of the difference by 3 plus 1; otherwise the fiscal quarter function calculates the result for the previous or next month of given DateTime depending on whether the input DateTime day is less or more than the startDay field.

Fiscal Week Function

  • The Beginning method sets the start date of the first week in the input year. If start date is more than input date, the program calculates start date for the previous fiscal year.
  • The function calculates the result as a sum of a difference between the start and input dates and the day of week offset from the first day of week divided by 7.

Documentation

About

This example shows how to add fiscal functions to the WinForms Dashboard in a client mode.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •