The quarter can be offset by period_no.
period_no is an integer, where the
value 0 indicates the quarter which contains base_date.
Negative values in period_no indicate
preceding quarters and positive values indicate succeeding quarters.
first_month_of_year
If you
want to work with (fiscal) years not starting in January, indicate
a value between 2 and 12 in first_month_of_year.
Scripting examples
Example
Result
inquarter ('25/01/2013', '01/01/2013',
0)
Returns True
inquarter ('25/01/2013', '01/04/2013',
0)
Returns False
inquarter ('25/01/2013', '01/01/2013',
-1)
Returns False
inquarter ('25/12/2012', '01/01/2013',
-1)
Returns True
inquarter ('25/01/2013', '01/03/2013',
0, 3)
Returns False
inquarter ('25/03/2013', '01/03/2013',
0, 3)
Returns True
Example:
Add the example script to your app and run it. To see the result, add the fields listed in the results column to a sheet in your app.
This example checks if an invoice date falls in the fourth quarter of the fiscal year specified by setting the value of first_month_of_year to 4, and having the base_date 31/01/2013.
TempTable:
LOAD RecNo() as InvID, * Inline [
InvDate
28/03/2012
10/12/2012
5/2/2013
31/3/2013
19/5/2013
15/9/2013
11/12/2013
2/3/2014
14/5/2014
13/6/2014
7/7/2014
4/8/2014
];
InvoiceData:
LOAD *,
InQuarter(InvDate, '31/01/2013', 0, 4) AS Qtr4FinYr1213
Resident TempTable;
Drop table TempTable;
The resulting table contains the original dates and a column with the return value of the inquarter() function.
Results table
InvDate
Qtr4Fin1213
28/03/2012
0 (False)
10/12/2012
0 (False)
5/2/2013
-1 (True)
31/3/2013
-1 (True)
19/5/2013
0 (False)
15/9/2013
0 (False)
11/12/2013
0 (False)
2/3/2014
0 (False)
14/5/2014
0 (False)
13/6/2014
0 (False)
7/7/2014
0 (False)
4/8/2014
0 (False)
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!