Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 14 Oracle Analytics Lounge
- 214 Oracle Analytics News
- 42 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 78 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
How To Set First Day And Last Day Of Previous Month As Default Value For Parameters?

Hi everyone,
I’d like to know if there’s any way to set the Default Value of a Parameters date field to automatically get the first and last day of the previous month, or if there are any alternative solutions.
Best Answer
-
Hi @Gavi,
You can achieve last day of previous month by using the following function in the default value:
Last day of the previous month:
{$FIRST_DAY_OF_MONTH()-1$}The First Day of Previous Month functions are not supported in the BI Default Date parameters.
Here is a workaround:
Create an LOV:
SELECT ADD_MONTHS((LAST_DAY(SYSDATE)+1),-2) FROM DUAL
Now create a Menu parameter based on the above LOV.
Hope this help.
Thank you.
1
Answers
-
Hi @Gavi,
Welcome to the Oracle Analytics Community!
Please use the following as default values, it should work.
First Day of Month: {$FIRST_DAY_OF_MONTH()$} Last Day of Month: {$LAST_DAY_OF_MONTH()$}
Hope this help.
Thank you.
1 -
Hi Bhaskar,
Thanks for your reply.I tested
{$FIRST_DAY_OF_MONTH()$}
and{$LAST_DAY_OF_MONTH()$}
, but they give the first and last day of the current month.
What I actually need is the first and last day of the previous month.Is there a way to shift these functions by -1 month, so the parameter defaults to last month’s range instead of this month’s?
Thank you again for the help!
0