FIQTR: Obtaining the Financial Quarter

How to:

The FIQTR function returns the financial quarter corresponding to a given calendar date based on the financial year starting date and the financial year numbering convention.

Since Dialogue Manager interprets a date as alphanumeric or numeric, and FIQTR requires a standard date stored as an offset from the base date, do not use FIQTR with Dialogue Manager unless you first convert the variable used as the input date to an offset from the base date.

Syntax: How to Obtain the Financial Quarter

FIQTR(inputdate, lowcomponent, startmonth, startday, yrnumbering, output)

where:

inputdate

Date

Is the date for which the financial year is returned. The date must be a standard date stored as an offset from the base date.

If the financial year does not begin on the first day of a month, the date must have Y(Y), M, and D components, or Y(Y) and JUL components (note that JUL is equivalent to YJUL). Otherwise, the date only needs Y(Y) and M components or Y(Y) and Q components.

lowcomponent

Alphanumeric

Is one of the following:

  • D if the date contains a D or JUL component.
  • M if the date contains an M component, but no D component.
  • Q if the date contains a Q component.
startmonth

Numeric

1 through 12 are used to represent the starting month of the financial year, where 1 represents January and 12 represents December. If the low component is Q, the start month must be 1, 4, 7, or 10.

startday

Numeric

Is the starting day of the starting month, usually 1. If the low component is M or Q, 1 is required.

yrnumbering

Alphanumeric

Valid values are:

FYE to specify the Financial Year Ending convention. The financial year number is the calendar year of the ending date of the financial year. For example, when the financial year starts on October 1, 2008, the date 2008 November 1 is in FY 2009 Q1 because that date is in the financial year that ends on 2009 September 30.

FYS to specify the Financial Year Starting convention. The financial year number is the calendar year of the starting date of the financial year. For example, when the financial year starts on April 6, 2008, the date 2008 July 6 is in FY 2008 Q2 because that date is in the financial year that starts on 2008 April 6.

output

I or Q

The result will be in integer format, or Q. This function will return a value of 1 through 4. In case of an error, zero is returned.

Note: February 29 cannot be used as a start day for a financial year.

Example: Obtaining the Financial Quarter

The following request against the CENTHR data source obtains the financial quarter corresponding to an employee starting date (field START_DATE, format YYMD) and returns the values in each of the supported formats: Q and I1.

DEFINE FILE CENTHR
FISCALQ/Q=FIQTR(START_DATE,'D',10,1,'FYE',FISCALQ);
FISCALI/I1=FIQTR(START_DATE,'D',10,1,'FYE',FISCALI);
END
TABLE FILE CENTHR
PRINT START_DATE FISCALQ FISCALI
BY LNAME BY FNAME
WHERE LNAME LIKE 'C%'
END

On the output, note that the date November 12, 1998 (1998/11/12) is in fiscal quarter Q1 because the starting month is October (10):

Last            First         Starting
Name            Name          Date        FISCALQ  FISCALI
----            -----         --------    -------  -------
CHARNEY         ROSS          1998/09/12  Q4             4
CHIEN           CHRISTINE     1997/10/01  Q1             1
CLEVELAND       PHILIP        1996/07/30  Q4             4
CLINE           STEPHEN       1998/11/12  Q1             1
COHEN           DANIEL        1997/10/05  Q1             1
CORRIVEAU       RAYMOND       1997/12/05  Q1             1
COSSMAN         MARK          1996/12/19  Q1             1
CRONIN          CHRIS         1996/12/03  Q1             1
CROWDER         WESLEY        1996/09/17  Q4             4
CULLEN          DENNIS        1995/09/05  Q4             4
CUMMINGS        JAMES         1993/07/11  Q4             4
CUTLIP          GREGG         1997/03/26  Q2             2