weekOfMonth#
- swordfish.function.weekOfMonth()#
In the calendar month of X, suppose the “week”-th “weekday” is d.
If X<d: return the week-th “weekday” in the previous calendar month.
If X>=d: return the week-th “weekday” in the current calendar month.
If parameter offset is specified, the result is updated every n months. Parameter offset works only if parameter n>1.
- Parameters:
X (Constant) – A scalar/vector of type DATE, DATETIME, DATEHOUR, TIMESTAMP or NANOTIMESTAMP.
week (Constant, optional) – An integer from 0 to 3 indicating the i-th week of a month, by default DFLT.
weekday (Constant, optional) – An integer from 0 to 6. 0 means Monday, 1 means Tuesday, …, and 6 means Sunday, by default DFLT.
offset (Constant, optional) – A scalar of the same data type as X. It must be no greater than the minimum value of X, by default DFLT.
n (Constant, optional) – A positive integer, by default DFLT.