Skip to main content

What are date functions in formulas?

A date function is a formula component that can calculate the number of days, workdays, holidays, weeks, months, years, and other date-related metrics.

Date functions allow you to calculate KPIs more precisely. It's particularly relevant for metrics that calculate the average.

The numbers you get from date functions depend on the time period you select on a widget. For example, Workdays will give the number 5 if the time period on the widget is Current week.

Available date functions

The list of available date functions slightly differs from the Advanced to Visual formula editors.

Here's a list of date functions we support currently:

  • Visual editor: Workdays, Holidays, Days, Weeks, Months, Years.

  • Advanced editor: NetWorkDays, Holidays, Days, Weeks, Months, Years, Hour, Day, Month, Year.

Date and time objects

Each of the date functions includes smaller arguments called date and time objects. These are indicators that tell Plecto when or what to consider.

For example, if you want to use Days, you need to tell Plecto how many days you want to calculate. If you choose from Widget start date to Widget end date, Plecto will say 7 if the widget's time period is Current week.

Here's a list of date and time objects you can add:

Visual editor

Advanced editor

Description

Today

Today()

Today until 23:59:59.

Now

Now()

The date and time right now.

Widget start date

Startdate()

The start date and time of the selected time period on the widget.

Widget end date

Enddate()

The end date and time of the selected time period on the widget.

Fixed date

Date(yyyy,mm,dd)

Allows you to select a fixed custom date range.