Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
carol_wu
Partner - Contributor
Partner - Contributor

Accumulate sum Scripts

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?

Capture-1.JPG

1 Reply
shilpan
Partner Ambassador
Partner Ambassador

Solution attached