Dear all,

Let's suppose I have a variable displaying the amount of input in a given industry for each country: X_AUSTRALIA, ..., X_JAPAN, ..., X_USA, etc.

My goal is to create a new variable for each country which would be the sum of X excluding the country I am interested in. For instance, for Australia, I want the sum of X over all countries except Australia, and so on for each country.

Ideally, I would like to do that in a loop since I have a lot of countries. I have already created a global containing all the countries.

Anyone has an idea about how to produce theses variables within a loop ? That would be very appreciated. Thank you.