All eazyBI for Jira eazyBI for Confluence Private eazyBI

DateToTimestamp

EAZYBI Transforms date and time from date format to Unix timestamp format (integer).

Syntax

DateToTimestamp(Date_Expression)

Arguments

Date_Expression

MDX expression that returns a date value.

Examples

The DateToTimestamp() function allows you to pass date values to functions that expect numeric arguments.

In this example, the Max() function is used to find the latest issue updated date from all issues. The date is first converted to Unix timestamp to pass to the Max() function and after that, the largest value found by the Max() function is converted back to date format with the TimestampToDate() function:

TimestampToDate(
  Max(
    Filter(
      Descendants([Issue].CurrentMember,[Issue].[Issue]),
      [Measures].[Issues created]>0
    ),
    DateToTimestamp([Measures].[Issue updated date])
  )
)

Be sure to set the Formatting for the measure to Date format.

The function CoalesceEmpty() also does not support date values, so it's possible to convert the date values to integer values and convert the end result back to date format:

TimestampToDate(
  CoalesceEmpty(
    DateToTimestamp([Measures].[Issue resolution date]),
    DateToTimestamp([Measures].[Issue due date]),
    DateToTimestamp(DateParse("today"))
  )
)

See also

  • Use TimestampToDate() function to convert Unix timestamp integer values to date and time format.