BookmarkSubscribeRSS Feed
DandarahZ
Obsidian | Level 7

Hello,

Capture6.JPG

 

In this picture above I have created a variable that shows the values from 1 - 7 reflecting the days of the week. However, i would now like for the 1-7 values to be reflected as day values (Monday, Tuesday, Wednesday). As I intend to use it in a slider, the slider only accepts values that are measure in nature. Can someone give me pointers on how to solve this issue?

 

Regards

Dan

2 REPLIES 2
FredrikE
Rhodochrosite | Level 12

Hi!

I think the easiest could be to create a custom category for the weekdays and use a list or button bar for the selection.

As you say, the slider won't work.

//Fredrik

Kurt_Bremser
Super User

You can display (and convert to a new variable, if needed) SAS date values as the weekday directly by using the DOWNAME. format, no need to extract the numeric weekday first:

data _null_;
format date downame.;
do date = today() - 6 to today();
  put date=;
end;
run;

Log:

 73         data _null_;
 74         format date downame.;
 75         do date = today() - 6 to today();
 76           put date=;
 77         end;
 78         run;
 
 date=Thursday
 date=Friday
 date=Saturday
 date=Sunday
 date=Monday
 date=Tuesday
 date=Wednesday

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

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
  • 2 replies
  • 1126 views
  • 0 likes
  • 3 in conversation