Coffee77
Honored Contributor II

Try to use this code customized in the way you need:

Coffee77_0-1764061670888.png

Instead of using monotonically_increasing_id function directly, use row_number over the previous result. This will ensure sequential "small" numbers. This was indeed the exact solution I used to solve some similar issues in which I kept monotonically_increasing_id function 


Lifelong Solution Architect Learner | Coffee & Data