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

My code looks as following

 


proc tabulate data=invand(where=(fodelselandgrupp^='Sverige')) order=formatted missing;
title 'GFB och ålder inkl missing';
class gfb alderinv kon ;
table (kon='' all='Totalt')*(alderinv='' all='Alla'),(gfb='GFB' all='Alla')*(N='' rowpctn='Row %' pctn<kon all>='Col %')/box= 'Ålder vid invandringsår';
format alderinv aldkat. gfb gfbgrupp. kon $kon.;
run;
title;

 

With output attached 

 
I want the column percentage to sum up into 100% witihin the variable "kon", (witihin "Kvinnor" and "Män").

 

How can I do that?

 
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hello @TobbeNord,

 

Please replace

pctn<kon all>

with

pctn<alderinv all>

and check if the new results meet your expectations.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hello @TobbeNord,

 

Please replace

pctn<kon all>

with

pctn<alderinv all>

and check if the new results meet your expectations.

TobbeNord
Obsidian | Level 7
Great!! Of course! Stupid of me.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 807 views
  • 0 likes
  • 2 in conversation