I want to create a dataset that have three variables(customer_num, total_bads, and current_bads). For every observation I want current_bads =customer_num and total_bads is then deducted by the number of current_bads until total_bads =0 For example(the initial total_bads is 60): Customer_num Current_bads Total_bads 19 19 41 10 10 31 25 25 6 20 6 0 30 0 0 15 0 0 I am trying to use loop but my code doesn’t stop when total_bads reaches 0. Can someone help me with it? Thank you such!
... View more