Oracle Analytics Cloud and Server

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

How to get current month and Year on a report

Received Response
92
Views
3
Comments
Ravi0013
Ravi0013 Rank 1 - Community Starter

Hello All

Can any one guide me how to get current month, year on a report for example Jul, 2016? I would like to see couple of ways to do it 1) In rpd 2) on the report directly.

Thanks

Ravi

Answers

  • Hi,

    Not really sure what you expect as answer but did you try looking at the available functions when editing a column of an analysis? There is a full block of functions for dates. There you find CURRENT_DATE which is, like the name says, the current date. You can then format it the way you need or also use some extra functions to get Month and Year.

    In the RPD same business: you have the function available.

    In general the current date isn't really interesting as only few people have a real time analytical system, so the date you are probably looking for is the last loaded date related to your data. This one is generally found by a query on your DB and stored into a repository variable so you can use it everywhere you need it as filter or anything else.

  • Ravi0013
    Ravi0013 Rank 1 - Community Starter

    Thanks Gianni. I looked at the functions, the two I thought close were MonthName(Current_Month) and Year(Current_Month) but  I am looking both in one column. It seems like a simple task but need some guidance.

  • You can concatenate the output of both adding a space in between :

    MonthName(...) || ' ' || CAST(Year(....) as VARCHAR2(4))

    You just have to cast the output of Year to a varchar to avoid OBIEE complaining you are concatenating incompatible types.