I have this dataset below -
FacultyID | Student ID | Term |
1 | 11 | 2010 |
1 | 11 | 2011 |
1 | 11 | 2012 |
1 | 12 | 2013 |
1 | 12 | 2014 |
1 | 13 | 2012 |
1 | 13 | 2013 |
1 | 13 | 2014 |
1 | 13 | 2015 |
2 | 15 | 2011 |
2 | 15 | 2012 |
2 | 15 | 2013 |
2 | 15 | 2015 |
2 | 15 | 2016 |
2 | 15 | 2017 |
2 | 16 | 2011 |
2 | 16 | 2012 |
2 | 16 | 2013 |
2 | 16 | 2014 |
3 | 17 | 2012 |
3 | 17 | 2014 |
3 | 17 | 2016 |
3 | 17 | 2018 |
3 | 17 | 2020 |
3 | 17 | 2022 |
3 | 17 | 2024 |
4 | 18 | 2012 |
4 | 18 | 2013 |
4 | 18 | 2014 |
4 | 18 | 2015 |
4 | 18 | 2016 |
4 | 19 | 2016 |
4 | 19 | 2017 |
4 | 20 | 2016 |
4 | 21 | 2012 |
4 | 21 | 2013 |
4 | 21 | 2014 |
4 | 21 | 2015 |
I am interested in calculating the Average Terms a faculty is associated with a student. In the above example the average terms for fac id 1 is 3 for 2 it is 5, for 3 it is 7 and for 4 it is 3.
Formula used is Sum(Count(Terms))/Count(Student ID) for every Faculty ID.
I have other category variables associated with the student id and faculty id and hence want to calculate the item dynamically instead of aggregating the dataset prior ro bringing it into VA 7.3.
Thanks for your responses.
Hi there. I think I have this figured out.
I used your data. These are the steps that I took:
I was able to create the results you were looking for.
Cheers, Roger
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.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.