Hi,
Any idea how I can convert my count and balance into a percentage?
proc sql;
create table work.kptoverall_&A1. as
select distinct month_date,
count(*) as count,
sum(balance_outstanding) as balance,
avg(balance_outstanding) as average_balance
from gbasel.basel&A2.
where optimum_platform = 'Optimum'
and overall_multiplier >= 3
and Overall_lit_stage_code not in ('L4','L5','L6')
group by month_date;
quit;
Hi,
Do you mean to put the result into a percentage format e.g.
count(*) as count format=percent7.1,
Or do you mean how to calculate a percentage?
Yes, i want the result in a percent rathr than a count or balance. RW9, i have tried to add the percent format as suggested but I get an error message - Tables with 0 columns are not supported by this object. Any ideas please?
Sounds like your not getting data from the query. Can I check what you mean however, can't really tell what you want from the text as its still vague between using a calculation to achieve a percent, or just adding % symbol? Maybe post some test data and required output.
Below is the current output, at the moment im getting the numeric field but I have added a column to the right to show the %. I need to repance the numeric number (second column)and replace with the percentage (third column).
Volume (#)
B 16,018 24%
R 16,669 25%
I 17,094 26%
R 16,206 25%
total 65,987 100%
If all you need is a report showing the %, PROC TABULATE does that automatically without having to change the data. If you actually need a data set holding the %, the answer will be very different. If you are determined to create a data set, you will need to create grand totals to use as denominators in your % calculations.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.