Oracle Transactional Business Intelligence

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

BI Published Report Date Variables

201
Views
3
Comments

Summary

Date variable for previous month

Content

Hello,

I was on this site: https://docs.oracle.com/middleware/12212/bip/BIPUG/GUID-BC0A8B60-1BB5-4D85-85BB-B199C1A5C418.htm#BIPUG219

I am looking for a variable for the previous month. something like {$PREVIOUS_MONTH()$}. Does that exist? 

Thanks,

Stephanie

Version

12.2.1.2.0

Comments

  • Mihaela M
    Mihaela M Rank 3 - Community Apprentice

    Hi,

    If you are using RTF templates you have a lot of options. I can suggest you to take a look at https://blogs.oracle.com/xmlpublisher/date-functions for this.

  • slgott
    slgott Rank 4 - Community Specialist

    Hello,

    Thank you for your response. We use XSL stylesheet as the RTF limits the amount of columns we can display to our users. Having said that though, what I'm trying to do is set the default in the prompt to be 'previous month'. So in the parameters section of the data model, we've used the '{$SYSDATE()$} variables but I can't find for previous month. Hope this helps clarify. 

    Thanks,

    Stephanie

  • Sahil Makhiza
    Sahil Makhiza Rank 3 - Community Apprentice

    Hi Stephanie

    We just have the following variables available to default the date in parameters

    {$SYSDATE()$} - current date, the system date of the server on which BI Publisher is running.

    {$FIRST_DAY_OF_MONTH()$} - first day of the current month

    {$LAST_DAY_OF_MONTH()$} - last day of the current month

    {$FIRST_DAY_OF_YEAR)$} - first day of the current year

    {$LAST_DAY_OF_YEAR)$} - last day of the current year

    So can play with these variables to achieve your requirement as there is no such variable that will help you to directly get the previous month.

    The other option is to default the sysdate and use the logic in the Data Model SQL to obtain the data for previous month.

    Regards,

    Sahil