Oracle Analytics Cloud and Server

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

current_date auto change when it's Monday

Received Response
1
Views
4
Comments
PJ CHEN
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!!

擷取.PNG

Answers