Categories
- All Categories
- Oracle Analytics and AI Learning Hub
- 53 Oracle Analytics and AI Sharing Center
- 20 Oracle Analytics and AI Lounge
- 293 Oracle Analytics and AI News
- 57 Oracle Analytics and AI Videos
- 16.4K Oracle Analytics and AI Forums
- 6.5K Oracle Analytics and AI Labs
- Oracle Analytics and AI User Groups
- 116 Oracle Analytics and AI Trainings
- 21 Oracle Analytics and AI Challenge
- Find Partners
- For Partners
Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture
current_date auto change when it's Monday
PJ CHEN
Rank 1 - Community Starter
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!!

0
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
