Su Jaques 

liked
Replying to

This is for unbounded retention. You can see the activity date is set as a range : AND (n.signup_date + interval '30 days') >= a.activity_date -- retention data for the next 30 days after signup

For X-day you would have to define a specific activity date, for example: AND (n.signup_date + interval '30 days') = a.activity_date

line #36: https://gist.github.com/ks--ks/446e6d78e8a49048d4eabf55c3363309