November 5, 2024

I have a dataset with two columns: id and date. The dates are monthly and span from Mar-21 to Aug-21. I am sure this question could be applied to non-date values, but I think dates are more intuitive for this example.

 id | date   |
----+--------+--
 a  | Mar-21 | 
 a  | Apr-21 | 
 a  | Aug-21 | <---- 'a' is missing Jun-21 and Jul-21
 b  | Mar-21 | 
 b  | May-21 | <---- 'b' is missing Apr-21
 b  | Jun-21 | 
 b  | Jul-21 | 
 b  | Aug-21 | 

And I want this

 id | date   |
----+--------+--
 a  | Mar-21 | 
 a  | Apr-21 | 
 a  | May-21 | 
 a  | Jun-21 | <---- 'a' gets Jun-21 
 a  | Aug-21 | <---- ...and now Jul-21
 b  | Mar-21 | 
 b  | Apr-21 | <---- 'b' gets Apr-21
 b  | May-21 | 
 b  | Jun-21 | 
 b  | Jul-21 | 
 b  | Aug-21 | 

Basically I want to say “I want every single id to get all unique values of date.