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

Hello

I have a summary table (data set) with number of customers in each category (Z1,Z2).

What is the way to dispaly this table with percent from total.

So in first row I expect to get:

A Q1 500/2000 300/2000 200/2000 400/2000 600/2000

in second row i expect to see 

A Q2 600/3200 200/3200 1200/3200 900/3200 300/3200

and so on

 



Data have;
Input Z1 $ Z2 $ X1 X2 X3 X4 X5;
cards;
A Q1 500 300 200 400 600
A Q2 600 200 1200 900 300
A Q3 300 200 200 700 1000
B Q1 500 800 1300 1000 1500
B Q2 400 200 300 600 500
B Q3 500 600 800 700 300
C Q1 900 800 300 800 1200
C Q2 400 200 700 200 700
C Q3 400 500 600 300 600
;
Run;

 

1 ACCEPTED SOLUTION
2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

Do you want this in a data set ?

 

So the fractions will be character values, right?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 419 views
  • 1 like
  • 3 in conversation