Oracle Fusion HCM Analytics

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How to populate employee start date with current year?

Accepted answer
33
Views
4
Comments
Scott_Turner_
Scott_Turner_ Rank 5 - Community Champion
edited May 20, 2024 3:36AM in Oracle Fusion HCM Analytics

I have created a field which is extracting the day and month from an employee's start date and combining with the current year (see below). I am having trouble casting this back as a date field can anyone advise how I would do this or a better way to extract day/month from start date and combine with the current year?

Thanks, Scott

Additional Info: The field is populating as expected (see below Anniversary Date) but is populating as an Attribute and I can not convert to a Date field.

Tagged:

Best Answer

  • Orange
    Orange Rank 5 - Community Champion

    Hi @Scott_Turner_ ,

    Please try the following calculation:

    CASE

    WHEN TIMESTAMPADD(SQL_TSI_YEAR, CAST(YEAR(CURRENT_DATE) - YEAR(Legal Employer Seniority Date) AS INT) , Legal Employer Seniority Date) <= CURRENT_DATE

    THEN TIMESTAMPADD(SQL_TSI_YEAR, CAST(YEAR(CURRENT_DATE)+1 - YEAR(Legal Employer Seniority Date) AS INT) , Legal Employer Seniority Date)

    ELSE TIMESTAMPADD(SQL_TSI_YEAR, CAST(YEAR(CURRENT_DATE) - YEAR(Legal Employer Seniority Date) AS INT) , Legal Employer Seniority Date)

    END

    Kind regards

Answers