Date Function Enhancements

Why is it Useful?

CMiC has enhanced calculated fields in the BI Dashboard Builder tool to support additional features using date fields. Users can now do more with date fields such as truncating dates to the nearest month or year (date.truncate()), return today’s date (date.today()), and using date fields in conditional formatting statements.

NOTE: This feature was released in Patch 16.

How Does it Work?

date.today

Return the current server date without the time portion.

Syntax:

date.today()

date.truncate

Return a date truncated to a specified unit. The unit is optional. Without providing a unit, the function returns a date truncated to the day portion of <dateTime>. In other words, it returns <dateTime> without the time portion.

Syntax:

date.truncate([<unit>], <dateTime>)

<unit> supported values are “year” and “month”. “year” truncates <dateTime> to the first day of the year. “month” truncates <dateTime> to the first day of the month.

<dateTime> can be a date field reference or function that returns a date.

For more information on using calculated fields in the BI Dashboard Builder tool, refer to Visualization Calculated Fields.

To learn more about some of the latest features released in this patch, return to Patch 16 Highlights.