I'm trying to calculate the average difference from each persons salary from the highest salary for their job title. I keep getting an error that the summary functions are nested in a way that's not supported and can't figure out why. Heres what I have.
Hi @matoma You need an extra pass. Please calculate your max(salary)-salary in 1st pass perhaps in an in line view and the compute the Avg in the outer query.
Example:
proc sql;
select 'level 1', avg(t) format=comma12. as Avgdiff
from (select max(salary)-salary as t from hw2.mechanicslevel1)
You can complete the rest using the above as template
Hi @matoma You need an extra pass. Please calculate your max(salary)-salary in 1st pass perhaps in an in line view and the compute the Avg in the outer query.
Example:
proc sql;
select 'level 1', avg(t) format=comma12. as Avgdiff
from (select max(salary)-salary as t from hw2.mechanicslevel1)
You can complete the rest using the above as template
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.