Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Reset rank when date interval exceeds limit - response (1) by Dolm

$
0
0

I may have found a a solution with the following, this appears to rank the way I wantd. Could someone sanity-check this for me?
 
 

RANK() OVER(
		PARTITION BY ID 
		ORDER BY "DATE"
		RESET WHEN (cast("date" as date) - min(cast("date" as date)) over(partition by ID order by "date" rows between 1 preceding and 1 preceding )) >= 30
		
		)  AS "RANK"

 


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>