Forum Discussion

ryan_b_fiting's avatar
ryan_b_fiting
Icon for Post Patron rankPost Patron
6 years ago

Finding the 'Current' Status based on most

Hello Community - 
 
We want to report for the last day of each historical month how many people were in each state. If that data looked like this (for a single learner):
 
LearnerId      Status       UpdateDate
000001          Enrolled   2020-04-01
000001          LOA          2020-05-14
000001          Dismissed 2020-07-20

 

This is the expected output I would want to see:

 

Date      Enrolled      LOA      Dismissed
2020-04      1              0               0
2020-05      0              1               0
2020-06      0              1               0
2020-07      0              0               1

 

What would be the most efficient way to write this to get the 'current' status based on the most recent update date within a specific period/date.

 

As always, thanks for your input!

Ryan F.

4 Replies