Hello!

I am currently working on a panel dataset containing, amongst others, the variables "companies", "year" (2010-2018), "sector" (arbitrary 4 digit number), and "net sales". Now,
I want to generate a new variable, namely, the sum of the net sales for all individual companies in each corresponding sector and the corresponding year.

I tried to find a command, however, I was unsuccessful.

Can anyone help me out?

Thank you in advance!