Skip to content
Advertisement

student Gradejump in a historical data with the specific date they had gradejump

I have a historical table holding daily student record. I want to get which date they had change of grade i.e from grade 3a to 3b as jump1 and from 3b to 5 jump2 with the relevant date. below is the script- problem with my script I dont want all the rows that there is no jump. “”

all I need the specific date the student had jump Jo should have only 2 rows jump 7 and jump 8a
hope explained it properly please ask me if I have not.
Many Thanks

Advertisement

Answer

I want to get which date they had change of grade i.e from grade 3a to 3b as jump1 and from 3b to 5 jump2 with the relevant date.

This sounds like conditional aggregation with lag():

If you don’t really care about the transition but only want the earliest date for each band, then this is even simpler:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement