fq
This function identifies the financial (or fiscal) quarter of the date provided. Example: fq( "2022-02-01", 3 ) returns 4
because February lies in the 4th quarter in the fiascal year ending in March. If a blank date is provided, then 0 is returned.
Vectorization: This function supports vectorization. Sets and nested sets containing input values are also supported.
Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter
2
No. | Type | Description |
---|---|---|
1 input |
date or string converted to date numeral set |
Date or month Specified data or month. Vectorization: Put multiple values into a (nested) set. |
2 input |
numeral | Month year ending Specify the last month of the financial year (Example: Specify 3 for fiscal years ending on 31. March every year). Value must be between 1 and 12. |
Type | Description |
---|---|
numeral set |
Result Quarter 1..4. If vectorization is applied, then the multiple values are returned in a set |
date[] = "2022-05-01";
echo( "Date is ", date[] );
for (month[]=1, month[]<=12, month[]++ )
echo( "Year ending in ", str( date(2022,month[],1),"Mmmm" ), ": ", fq( date[], month[] ) );
echo("Vectorization exmaple:");
echo( fq( { 31.12.2023, 01.01.2023, 06.01.2023,01.04.2024 }, 3 ) ); // Vectorization exmaple
echo("Numeric exmaple with months specified:");
echo( fq( { 11, 12, 1, 2, 3, 4 }, 3 ) ); // Vectorization exmaple
echo("String exmaple with months specified:");
echo( fq( { Mar, Apr, Dec, Jan }, 3 ) ); // Vectorization exmaple
Date is 2022-05-01
Year ending in January: 2
Year ending in February: 1
Year ending in March: 1
Year ending in April: 1
Year ending in May: 4
Year ending in June: 4
Year ending in July: 4
Year ending in August: 3
Year ending in September: 3
Year ending in October: 3
Year ending in November: 2
Year ending in December: 2
Vectorization exmaple:
{3,4,4,1}
Numeric exmaple with months specified:
{3,3,4,4,4,1}
String exmaple with months specified:
{4,1,3,4}