$begin(calendar,begin-level,date,offset-level,offset)—(1) Finds the member in the calendar at begin-level where date falls. (2) Finds the member at offset-level that starts on the same date as the member at begin-level (or failing that, the member at offset-level that contains the start date of the member at begin-level). (3) Finds the member at offset-level that is offset away from the member in (2) and returns its start date.
For example, if $today is 11/04/2006, the following expression will return the start of December in the Fiscal calendar. (The beginning of the current quarter is October, plus two months is December.)
$begin(Fiscal,Quarter,$today,Month,2)
In the following example, ${month} is of the form “M1”, “M2” for month 1, month 2. $substr(${month},1) returns the month string from index position 1 after “M” (the numeric portion of the month string). $add(…, -1) converts the one-based month number to 0-based. $begin() returns the start of the current ${month} in the Fiscal calendar.
$begin(Fiscal,Year,$today,Month,$add($substr(${month},1),-1))