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

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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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