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
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.