BookmarkSubscribeRSS Feed
Andalusia
Obsidian | Level 7

I have the following dataset:

data have;
infile datalines truncover;
input type $ quarter phase colors $ creation_date :yymmdd6.;
format creation_date yymmdd6.;
datalines;
K-11 201904 1 blue 20200101
K-11 202001 1 blue 20200101
K-11 202002 2 blue 20200101
K-11 202003 3 blue 20200101
K-11 202004 3 black 20200101
K-11 202101 1 blue 20200101
K-11 202102 2 blue 20200101
K-11 202103 3 blue 20200101
;

I want the column `colors` to be converted to a numeric value so I can use it as a measurement inside a crosstab in SAS Visual Analytics. How can this be done easily?

4 REPLIES 4
Andalusia
Obsidian | Level 7
What do you mean?
Patrick
Opal | Level 21

I'm not very experienced with VA reporting but even so I feel you will need to explain a bit more why you can't use color as a categorical variable. Show us a "mock-up" of the report you want to create using your sample data.

Do you just need counts by category "color"? Or what is this about?

ballardw
Super User

"Blue" does not have an automatic numeric value associated with it. So you would have to provide exactly what number you expect for "blue" or "black" or any other color.

 

Also perhaps if you describe how the number for "blue" will be used we can give you some pointers.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 630 views
  • 0 likes
  • 4 in conversation