Forum Discussion

OSAdmin's avatar
OSAdmin
Valued Contributor II
5 years ago

How to check if time period is the last month in a quarter?

Originally posted by Yan Savinsky

How to check if time period is the last month in a quarter in the Business Rule?

 

Thanks in advance.

 

Yan Savinsky

1 Reply

  • PhilB's avatar
    PhilB
    New Contributor III

    Hello Yan,

    There is no direct api to check for this (although there is one to check IsLastPeriodInYear), but the following line of code will work:

    If api.Time.GetPeriodNumFromId(optional TimeID) Mod 3 = 0 Then