Need help with increment

Hello I’m new to Mockaroo and I need help with creating data for my database assignment

Currently I’m trying to create simple code where H or num2 gets incremented whenever the sequence resets however my num2 variable seems to always forget the increment
How do I solve this issue?

https://www.mockaroo.com/2d1f75a0

Are you expecting the output to be as follows?

S1H1

S49H1
S50H2
S1H2

S49H2
S50H3

Yes I’m trying to output it as such

Will this work for you?

https://www.mockaroo.com/2d1f75a0

Yes it does, thank you