Calculate the number of days the quantity remained constant from a selected date

@satichun,

You may find the following post helpful in solving this. It’s not the exact same case, but very comparable - calculating the number of simultaneous periods in which a number stayed the same sign (as opposed to the exact same value):

  • Brian