select sum(hs_GPA)/sum(enrolled) from mytalbe
where ADMISSIONS_POPULATION = 'Enrolled' and enrolled >0 and hs_gpa is not null;
The closest thing I have is
case when (<<Measures.HS_GPASUM_for Calc>> is null) then null else sum(<<Measures.HS_GPASUM_for Calc>>)/suM(<<Measures.ENROLLEDSUM>>) end
Then I set a filter on where enrolled.
However, the result comes out to .2 rather than an expected GPA. Its records with null GPA are still being calculated.
I'm confused, what are you trying to convert to an expression?
select sum(hs_GPA)/sum(enrolled) from mytable
where ADMISSIONS_POPULATION = 'Enrolled' and enrolled >0 and hs_gpa is not null;
Ok, but why convert, why not leave as is?
This may be an alternative:
sum(hs_GPA*(admissions_population='Enrolled' and enrolled>0 and hs_gpa is not null))/sum(enrolled*(admissions_population='Enrolled' and enrolled>0 and hs_gpa is not null))
I'm confused. If I need to access the dimension in Web Report Studio don't I need to convert it to an expression to use a custom data item?
My bad. Missed the WRS portion. I have no idea about it.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.