Count number of rows depending on a condition

Anne_P
Anne_P Registered Posts: 2

Hello,

I would like to increment the number of rows group by some variables only when a condition between a date and its lag is true. The idea is the following :

if it is the first time we encounter an id, then var = 1;

else if id = id_lag and dat - dat_lag > 30 then var = var +1 ;

I try to do this with a window recipe but I can't. Can you help me please ?

Answers

Setup Info
    Tags
      Help me…