Giter Club home page Giter Club logo

how-to-calculate-fiscal-functions-for-date-time-data-fields's Introduction

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 the DateTime input if it is before the start of a new fiscal year; otherwise returns the year plus 1.

Fiscal Quarter Function

If a difference between the input DateTime month, and the startMonth field 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 previouse fiscal year.
  • The function calculates the result as a sum of differences between the start and input dates and the day of week offset from the first day of week divided by 7.

Documentation

how-to-calculate-fiscal-functions-for-date-time-data-fields's People

Contributors

fedosongit avatar ritazakhodyaeva avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.