Skip to content

DAYNUM(), MONTHNUM(), and YEARNUM()

By Optuma Team · Updated 2020-09-03

These functions returns integers for their respective values:

DAYNUM() will show the day of the month, ranging from 1 to 31.

MONTHNUM() shows the month as a value between 1 and 12.

YEARNUM() will show the year eg 2020.

Example showing 2020 2nd quarter performance using the MONTHNUM() and YEARNUM() functions:

//Get quarter end for June
M1 = MONTHNUM() == 6 and YEARNUM() == 2020;
//Get quarter end for March
M2 = MONTHNUM() == 3 and YEARNUM() == 2020;
//Get closing values for above dates
V1 = VALUEWHEN(M1);
V2 = VALUEWHEN(M2);
//Calculate % change
((V1/V2)-1)

MONTHNUM() and YEARNUM() Example

Choose which categories of cookies you allow. Strictly-necessary cookies are always on. You can change this any time via the "Cookie Settings" link in the footer.

  • Functional

    Remember preferences like dismissed banners and your dark-mode choice.

  • Analytics

    Help us understand how the site is used so we can improve it.

  • Marketing

    Measure our advertising and help us reach people who may be interested in Optuma.