hello I am trying to calculate the variations in the states of a person I know this by putting 1 when the client is active 0 when he is inactive I need to identify in which period the client went from being inactive to being active and from active to inactive.
THIS IS MY TABLE
This is the result I would like to get
Hello @lelloba thank you very much for wanting to help me with my problem, your solution does what I need, however I think it is a good solution when you have a small number of clients, in my case I have more than 100,000 and the time it takes is quite a bit, even I keep running it to see how much the total is. Thank you very much for the help.
Hello, thank you very much for the solutions, very elegant by the way, I appreciate you taking the time to help me and teach me a new way of doing it. It is all I needed now if I can continue, I reiterate again thank you both very much for such good solutions.