datediff(d, startdate, enddate) as Age
However default date format in OBIEE is Timestamp. So you need timestamp function (Available under Calendar/Date Function Heading) to get required result.
TIMESTAMPDIFF(interval, timestamp1, timestamp2)
interval is the specified interval. Valid values are:
timestamp1 and timestamp2 are any valid timestamps.
For Number of Days between two days:
TimestampDiff(SQL_TSI_DAY, “FROM_DATE_COLUMN”, “TO_DATE_COLUMN”)
For Number of Days till current date:
TimestampDiff(SQL_TSI_DAY, “FROM_DATE_COLUMN”, CURRENT_DATE)
*You can also use this function for getting age difference for other time dimension attributes as week, quarter, month or year. All you need to do is change first attribute i.e ‘interval’ & other attribute’s accordingly.