title: Snowflake: Ranking row numbers into groups in intervals of 7 (ie: 1-7 is assigned 1, 8-14 is assigned 2, 15- 21 etc) partitioned by a column
body: <p>This is my desired output:
  <a href="https://i.stack.imgur.com/4XExa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4XExa.png" alt="enter image description here" /></a></p>
  <p>Row no. is already via a COUNT windows function partitioned by group.</p>
  <p>The only way I can think of is to use CASE WHEN, but then I'll have to write so many lines of code and as the data is stream, I'll have to constantly alter and update the code to reflect the new data. For example, one group has over 2,000 rows of data.</p>