BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DandarahZ
Obsidian | Level 7

Hello,

 

I have a data set with a "Time" column. In this column, the data is saved in the DATETIME format (dd/mm/yyyy hh: mm). In VA, I managed to segregate the values into 2 new variables. The first being Date, the second being Time.

 

I, however, would like to now modify the DATE variable to exclude dates that are on the weekends. Can i get some help on this matter

 

Regards

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
FredrikE
Rhodochrosite | Level 12

Hi!

I mest you should add a FILTER, not to create a calculated item 🙂

But if you want that, just remove the ”<6” from your expression.

 

//Fredrik

View solution in original post

4 REPLIES 4
Jagadishkatam
Amethyst | Level 16

Please try, here the x represents 6=saturday and 7=sunday which we are excluding

 

data want;
set have;
x=weekday('16mar97'd);
if x not in (6,7);
run;
Thanks,
Jag
FredrikE
Rhodochrosite | Level 12

Hi!

You can add a filter with the following expression:

 

DayOfWeek('Date'n) < 6

 

//Fredrik

DandarahZ
Obsidian | Level 7

Hello Mr Fredrick,

 

I thank you for your reply. However, when trying to input the formula, an error gets thrown stating that it is unable to carry out the process due to a type error.

 

Capture4.JPG

 

Regards,

Dan

 

FredrikE
Rhodochrosite | Level 12

Hi!

I mest you should add a FILTER, not to create a calculated item 🙂

But if you want that, just remove the ”<6” from your expression.

 

//Fredrik

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 2225 views
  • 0 likes
  • 3 in conversation