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.
Find the latest issue updated date from all issues
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.
See also
- Use TimestampToDate() function to convert Unix timestamp integer values to date and time format.