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

I have two columns in a table. 
I need to find the number of rows in which Rating_a is not equal to Rating_b and then divide that number by the total number of rows in the table. Basically, I need to find the percentage of where the values differ. Could someone please help me with this? I think using the COUNT function could work. Help would be appreciated. Thank you.
Here's a sample (actual table has 1000s of rows) of how it looks like:

Rating_a   Rating_b
1 1
2 3
4 4
4 1
3

3

1 ACCEPTED SOLUTION
3 REPLIES 3
SASuser4321
Obsidian | Level 7
To show changes, one would have to write "rating_a ne rating_b" instead of using the = sign. But thank you for your answer. I understood it and it works and I'm accepting it 🙂
PaigeMiller
Diamond | Level 26

Would there ever be missing values? How would those be handled?

--
Paige Miller

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 453 views
  • 1 like
  • 3 in conversation