Categories
- All Categories
- Oracle Analytics Learning Hub
- 31 Oracle Analytics Sharing Center
- 22 Oracle Analytics Lounge
- 252 Oracle Analytics News
- 45 Oracle Analytics Videos
- 16.1K Oracle Analytics Forums
- 6.3K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 93 Oracle Analytics Trainings
- 16 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
