3 Replies Latest reply: May 14, 2014 4:45 AM by Dimitris Charalampou RSS

    calculate the maximum number of consecutive months where a field is equal to zero

      Hi to all,

      I have a table with 3 fields like the example below.

       

      I want to calculate during load for each id, the maximum number of consecutive months where the transactions field is equal to zero.

      So for this example , for id 1 the value should be equal to 4 and for the id 2 it should be equal to 3.

       

      idmonthtransactions
      1January12
      1February32
      1March0
      1April0
      1May0
      1June0
      1July43
      2March0
      2April0
      2May0
      2June23
      2July555
      2August0

       

      Any suggestions?

       

      Thank you all in advance.