Count number of rows depending on a condition

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 ?

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.