Instead of MAX use LAST_VALUE for time-based data

Watch Out for Modulo and Hashes

Welcome to dataframe.ca