Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 15 Oracle Analytics Lounge
- 215 Oracle Analytics News
- 43 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 78 Oracle Analytics Trainings
- 15 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
current_date auto change when it's Monday

hi all,
I have a question about how to change the current_date,
I used CURRENT_DATE-2 to get the data,
however, I wounder can it auto update to CURRENT_DATE-4 when it's Monday
for example, in R , I will try like this :
if(weekdays.Date(Sys.Date())=="Monday"){
datadate <-Sys.Date()-4}else(datadate <-format(Sys.Date()-2)
Many thanks!!
Answers
-
Hi,
you have a case statement in OBIEE
you also have a DayOfWeek function.
OBIEE: Calendar Date/Time Functions IN OBIEE
So, not hard to do the equivalent.
0 -
You'll need something like this:
CASE WHEN DAYOFWEEK(CURRENT_DATE) = 2 THEN TIMESTAMPADD(SQL_TSI_DAY, -4, CURRENT_DATE) ELSE TIMESTAMPADD(SQL_TSI_DAY, -2, CURRENT_DATE) END
0 -
THANKS YOU SO MUCH!!!
0 -
THANKS!
0