Long to Wide Dataset while adding new variable

Can you provide a reproducible example instead of a screenshot?