Oracle Analytics Cloud and Server

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

Year and Month Number format

Received Response
712
Views
4
Comments
User_JZKI6
User_JZKI6 Rank 4 - Community Specialist

Hi team,

We have date format column (6/21/2018 7:01:00 AM) we need extract year and month number ( 2018 06) from the date field in obiee RPD level can someone assist.

OBI Version using: Oracle Business Intelligence 12.2.1.4.0

Regards,

Tagged:

Answers

  • If you look at the available functions in OBIEE there is a whole set about dates, including extracting components from a date. Just look in the UI and you will see the list of functions available.

  • User_JZKI6
    User_JZKI6 Rank 4 - Community Specialist

    Thanks for the reply.

    We used below year and month functions but format we are getting is 20186, we are looking for 201806 can you suggest on this.

    CAST(YEAR("table.Date") AS CHAR)||CAST(MONTH("table.Date") AS CHAR)

    is there any other function which we can achieve in 201806 format

  • It's simple logic, if you don't store the right format in your database, you just have to build it by yourself.

    So with some basic logic you could multiply YEAR(date) by 100 and you sum it with MONTH(date) and you can finally turn the resulting number into a char if that's the format you are after.

  • SriniVEERAVALLI
    SriniVEERAVALLI Rank 6 - Analytics Lead

    Try using column data formats or else use string functions as Mr. Gianni suggested.