Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input double(date id price price_lag)
15718 1 50  .
15718 2 40  .
15718 3 30  .
15719 1 10 50
15719 2 20 40
15719 3 12 30
15720 1 36 10
15720 2 41 20
15720 3 56 12
15720 4 18  .
15721 1 45 36
15721 2  1 41
15721 3 46 56
15721 4 84 18
15721 5  4  .
end
format %tdMonth_DD,_CCYY date
I have date, id, and price variable and I want to generate the price_lag variable.

The issue is that if I do tsset date, it gives an error because of duplicate dates.

P.S: I have manually written the lag variable for this example.