My test data:
tableid id name weight weightdate
1 1 david 100 01/01/2020
2 1 david 100 01/01/2020
3 1 david NA NA
4 2 anne NA NA
5 3 peter 150 02/10/2020
6 3 peter 150 02/10/2020
I have some records of a same person (in this case david), which have both valid (100 and 01/01/2020) and NA data in weight and weightdate. Im looking to normalize the NA by replacing them with valid data from that person.
For the case of anne who doesnt have any valid data, i would leave it as is. I was thinking about using fill.
My desired output:
tableid id name weight weightdate
1 1 david 100 01/01/2020
2 1 david 100 01/01/2020
3 1 david 100 01/01/2020
4 2 anne NA NA
5 3 peter 150 02/10/2020
6 3 peter 150 02/10/2020