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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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
  • 1052 views
  • 0 likes
  • 3 in conversation