Need help on how i can achieve this in Qlikview. VCHSEQ is the column that will only populate 1 or 2 base on the condition of the previous row. I have tried to use peek and for loop but no success so far. Please refer to the attachment for more details. Any help is appreciated!