Skip to main content

NEXT_N_TIMEPERIOD

Written by Tom Williams

Type: Function

Function: NEXT_N_TIMEPERIOD

Syntax: NEXT_N_TIMEPERIOD(date, number, period)

Description: Returns true if the date is within the number of complete periods after the current one.

The period is "HOUR", "DAY", "WEEK", "MONTH", "QUARTER" or "YEAR", in upper or lower case.

The current period is not included: in May, the next 2 months are June and July.

It is the same condition as the Next filter of the insight designer (see Using filters). Use it in a custom formula, to count, group or label records on that condition, or as a filter in a query sent through the Keypup API or MCP server.

Sample usage:

  • NEXT_N_TIMEPERIOD(due_on, 2, "WEEK") returns true for the records due in the two weeks after this one.

Did this answer your question?