ROW_NUMBER returns one position for each row, even when the sort values tie. RANK gives tied rows the same rank and leaves a gap after the tie. DENSE_RANK also shares a rank but leaves no gap. Choose the function from the requirement: exactly one winner needs a complete sort order, while every tied winner needs a ranking function that preserves ties.
QUALIFY filters after Snowflake calculates the windows. WHERE still decides which input rows reach the window, so moving a date filter changes which rows can win. In a change feed, include a stable tie-breaker after the update timestamp. Otherwise the row chosen for a customer can change between runs.