Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I want to get the result that if there are accumulated flag_donated with 1, and I will create another column named tenure to add them.
For example, for 200708, there is a flag_donated with value 1, so the tenure value will be 1, and for 200709 with the flag value 1, the tenure value will be (1+1=2). And for 200711, there is a flag_donated with value 1, but the tenure will be 1, for 200712, the tenure will be 2. If the YearMonth is accumulated, the tenure will add 1.
How can I write the scripts on the data model?
Solution attached