How to create a retention table by metabase?

I was wondering how to create a retention table by metabase.

Every action created by user will insert a record in database, so the record will contain these keys: userid, event, createdAt, something else.

Then back into metabase, who can teach me how to create a retention table like the following image?

https://clevertap.com/blog/wp-content/uploads/2016/03/table1b.png
Thanks.