Originally posted by: Frank99
Hey everybody, I am looking for an sum or count function which solve my following problem:
I have an array which starts at 1 and ends at 10. The value of this arrays are 1 or 0. Now I would like to make a sum of the related values. If there is a 0 I want to start with another sum.
It should look like this for example.
In the beginning it should look like this:
Number Value
1 1
2 1
3 0
4 1
5 1
6 1
7 1
8 0
9 1
10 1
After the function it should look like this:
Number Value Sum value
1 1 2
2 1 2
3 0 0
4 1 4
5 1 4
6 1 4
7 1 4
8 0 0
9 1 2
10 1 2
I hope you understand my problem and could help me.
Thanks.
#CPLEXOptimizers#DecisionOptimization