Hello,

I would like to summarize for each year in (total_region_share1978, total_region_share1979, otal_region_share1980,......total_region_share2020 ) for each up_reg_code. Is it possible.


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str2 ctry_code str9 reg_code str70 reg_label str4 up_reg_code str60 up_reg_label float(total_region_share1978 total_region_share1979 total_region_share1980 total_region_share1981 total_region_share1982 total_region_share1983)
"AT" "AT111" "Mittelburgenland"                                        "AT11" "Burgenland (AT)"              .  .  .      .  .  .
"AT" "AT112" "Nordburgenland"                                          "AT11" "Burgenland (AT)"              .  2  1      .  1  2
"AT" "AT113" "Südburgenland"                                        "AT11" "Burgenland (AT)"              .  .  .      .  .  .
"AT" "AT121" "Mostviertel-Eisenwurzen"                                 "AT12" "Lower Austria"                .  .  .  1.018  .  2
"AT" "AT122" "Niederösterreich-Süd"                              "AT12" "Lower Austria"                .  .  2  .4106  .  2
"AT" "AT123" "Sankt Pölten"                                         "AT12" "Lower Austria"                .  .  .  .5354  .  4
"AT" "AT124" "Waldviertel"                                             "AT12" "Lower Austria"                .  .  .   .018  .  .
"AT" "AT125" "Weinviertel"                                             "AT12" "Lower Austria"                .  .  1      .  .  .
"AT" "AT126" "Wiener Umland/Nordteil"                                  "AT12" "Lower Austria"                .  .  1      3  1  .
"AT" "AT127" "Wiener Umland/Südteil"                                "AT12" "Lower Austria"                .  1  2      1  6  3
"AT" "AT130" "Vienna"                                                  "AT13" "Vienna"                       1 15 18     20  6 22
"AT" "AT211" "Klagenfurt-Villach"                                      "AT21" "Carinthia"                    .  .  2      1  .  1
"AT" "AT212" "Oberkärnten"                                          "AT21" "Carinthia"                    .  .  .      .  .  .
"AT" "AT213" "Unterkärnten"                                         "AT21" "Carinthia"                    .  2  .      .  .  .
"AT" "AT221" "Graz"                                                    "AT22" "Styria"                       .  4 12     13 13 13
"AT" "AT222" "Liezen"                                                  "AT22" "Styria"                       .  1  .      .  .  4
"AT" "AT223" "Östliche Obersteiermark"                              "AT22" "Styria"                       .  .  2 11.018  4 14
"AT" "AT224" "Oststeiermark"                                           "AT22" "Styria"                       .  .  .      1  1  .
"AT" "AT225" "West- und Südsteiermark"                              "AT22" "Styria"                       .  .  1      5  .  .
"AT" "AT226" "Westliche Obersteiermark"                                "AT22" "Styria"                       .  .  .      .  .  1
"AT" "AT311" "Innviertel"                                              "AT31" "Upper Austria"                .  .  1      1  2  3
"AT" "AT312" "Linz-Wels"                                               "AT31" "Upper Austria"                3  7  6     20 11 23
"AT" "AT313" "Mühlviertel"                                          "AT31" "Upper Austria"                .  1  .      1  2  1
"AT" "AT314" "Steyr-Kirchdorf"                                         "AT31" "Upper Austria"                .  .  3      4  1  7
"AT" "AT315" "Traunviertel"                                            "AT31" "Upper Austria"                .  .  .      2  2  6
"AT" "AT321" "Lungau"                                                  "AT32" "Salzburg"                     .  .  .      .  .  .
"AT" "AT322" "Pinzgau-Pongau"                                          "AT32" "Salzburg"                     .  .  .      .  .  .
"AT" "AT323" "Salzburg und Umgebung"                                   "AT32" "Salzburg"                     1  4  4     11  .  3
"AT" "AT331" "Außerfern"                                            "AT33" "Tyrol"                        1  .  1      1  1  .
"AT" "AT332" "Innsbruck"                                               "AT33" "Tyrol"                        .  .  .      1  3  3
"AT" "AT333" "Osttirol"                                                "AT33" "Tyrol"                        .  .  .      .  .  .
"AT" "AT334" "Tyrolean Oberland"                                       "AT33" "Tyrol"                        .  .  .      .  .  .
"AT" "AT335" "Tyrolean Unterland"                                      "AT33" "Tyrol"                        .  2  .      1  2  4
"AT" "AT341" "Bludenz-Bregenzer Wald"                                  "AT34" "Vorarlberg"                   .  .  .      .  .  .
"AT" "AT342" "Rheintal-Bodenseegebiet"                                 "AT34" "Vorarlberg"                   .  2  1      .  .  5
"AT" "ATZZZ" "Austria - not regionalised"                              "ATZZ" "Austria - not regionalised"   .  .  1      .  .  2
"AU" "AU101" "Capital Region"                                          "AU1"  "New South Wales"              .  .  .      .  .  .
"AU" "AU103" "Central West"                                            "AU1"  "New South Wales"              .  .  .      .  .  .
"AU" "AU104" "Coffs Harbour - Grafton"                                 "AU1"  "New South Wales"              .  .  .      .  .  .
"AU" "AU105" "Far West and Orana"                                      "AU1"  "New South Wales"              .  1  .      .  .  .
"AU" "AU106" "Hunter Valley Exc Newcastle"                             "AU1"  "New South Wales"              .  .  .      .  .  .
"AU" "AU107" "Illawarra"                                               "AU1"  "New South Wales"              .  .  .      2  .  .
"AU" "AU108" "Mid North Coast"                                         "AU1"  "New South Wales"              .  .  .      .  .  .
"AU" "AU109" "Murray"                                                  "AU1"  "New South Wales"              .  .  1      .  .  .
"AU" "AU110" "New England and North West"                              "AU1"  "New South Wales"              .  .  .      .  .  .
"AU" "AU111" "Newcastle and Lake Macquarie"                            "AU1"  "New South Wales"              .  .  2      .  .  .
"AU" "AU112" "Richmond - Tweed"                                        "AU1"  "New South Wales"              .  1  1      .  .  .
"AU" "AU113" "Riverina"                                                "AU1"  "New South Wales"              .  .  .      .  .  .
"AU" "AU114" "Southern Highlands and Shoalhaven"                       "AU1"  "New South Wales"              .  .  .      .  .  .
"AU" "AU1GS" "Sydney"                                                  "AU1"  "New South Wales"              2  9  3     10 15 22
"AU" "AU201" "Ballarat"                                                "AU2"  "Victoria"                     .  .  .      .  .  1
"AU" "AU202" "Bendigo"                                                 "AU2"  "Victoria"                     .  .  .      1  .  .
"AU" "AU203" "Geelong"                                                 "AU2"  "Victoria"                     .  .  .      .  .  .
"AU" "AU204" "Hume"                                                    "AU2"  "Victoria"                     .  .  .      .  .  .
"AU" "AU205" "Latrobe - Gippsland"                                     "AU2"  "Victoria"                     .  .  1      1  .  .
"AU" "AU215" "North West"                                              "AU2"  "Victoria"                     .  .  .      .  .  .
"AU" "AU216" "Shepparton"                                              "AU2"  "Victoria"                     .  .  .      .  .  .
"AU" "AU217" "Warrnambool and South West"                              "AU2"  "Victoria"                     .  .  .      .  .  .
"AU" "AU2GM" "Melbourne"                                               "AU2"  "Victoria"                     3 10 18     25 20 13
"AU" "AU306" "Cairns"                                                  "AU3"  "Queensland"                   .  .  .      .  .  .
"AU" "AU307" "Darling Downs - Maranoa"                                 "AU3"  "Queensland"                   .  .  .      .  .  .
"AU" "AU308" "Fitzroy"                                                 "AU3"  "Queensland"                   .  .  .      1  .  1
"AU" "AU309" "Gold Coast"                                              "AU3"  "Queensland"                   .  .  1      .  .  .
"AU" "AU312" "Mackay"                                                  "AU3"  "Queensland"                   .  .  .      .  .  .
"AU" "AU315" "Queensland - Outback"                                    "AU3"  "Queensland"                   2  .  .      .  .  .
"AU" "AU316" "Sunshine Coast"                                          "AU3"  "Queensland"                   .  .  1      .  .  .
"AU" "AU317" "Toowoomba"                                               "AU3"  "Queensland"                   .  .  .      .  .  .
"AU" "AU318" "Townsville"                                              "AU3"  "Queensland"                   .  .  .      .  .  .
"AU" "AU319" "Wide Bay"                                                "AU3"  "Queensland"                   .  .  .      .  .  .
"AU" "AU3GB" "Brisbane"                                                "AU3"  "Queensland"                   1  1  4      6  8  6
"AU" "AU405" "Barossa - Yorke - Mid North"                             "AU4"  "South Australia"              .  .  .      1  .  1
"AU" "AU406" "South Australia - Outback"                               "AU4"  "South Australia"              .  1  .      3  .  .
"AU" "AU407" "South Australia - South East"                            "AU4"  "South Australia"              .  .  .      .  .  .
"AU" "AU4GA" "Adelaide"                                                "AU4"  "South Australia"              .  3  3      3  3  1
"AU" "AU501" "Bunbury"                                                 "AU5"  "Western Australia"            .  .  .      .  .  .
"AU" "AU508" "Western Australia - Outback"                             "AU5"  "Western Australia"            .  .  .      .  .  .
"AU" "AU509" "Western Australia - Wheat Belt"                          "AU5"  "Western Australia"            .  .  .      .  .  .
"AU" "AU5GP" "Perth"                                                   "AU5"  "Western Australia"            .  .  3      3  4  3
"AU" "AU601" "Hobart"                                                  "AU6"  "Tasmania"                     .  .  .      .  2  .
"AU" "AU602" "Launceston and North East"                               "AU6"  "Tasmania"                     .  .  .      .  .  .
"AU" "AU603" "South East"                                              "AU6"  "Tasmania"                     .  .  .      .  .  .
"AU" "AU604" "West and North West"                                     "AU6"  "Tasmania"                     .  .  .      .  .  .
"AU" "AU701" "Darwin"                                                  "AU7"  "Northern Territory"           .  .  .      .  .  1
"AU" "AU702" "Northern Territory - Outback"                            "AU7"  "Northern Territory"           .  .  .      .  .  .
"AU" "AU801" "Australian Capital Territory"                            "AU8"  "Australian Capital Territory" .  4  5      1  .  2
"AU" "AUZZZ" "Australia - not regionalised"                            "AUZZ" "Australia - not regionalised" 1  5  2      1  3 12
"BE" "BE100" "Arr. de Bruxelles-Capitale / Arr. Van Brussel-Hoofdstad" "BE1"  "Brussels Capital Region"      2  9 12      7 14 11
"BE" "BE211" "Arr. Antwerpen"                                          "BE2"  "Flemish Region"               5 14 22      6 32 26
"BE" "BE212" "Arr. Mechelen"                                           "BE2"  "Flemish Region"               .  .  .      5  1  4
"BE" "BE213" "Arr. Turnhout"                                           "BE2"  "Flemish Region"               .  1  4      6  9  9
"BE" "BE221" "Arr. Hasselt"                                            "BE2"  "Flemish Region"               1  3  4      3  5  2
"BE" "BE222" "Arr. Maaseik"                                            "BE2"  "Flemish Region"               .  .  .      .  2  1
"BE" "BE223" "Arr. Tongeren"                                           "BE2"  "Flemish Region"               .  2  .      .  .  .
"BE" "BE231" "Arr. Aalst"                                              "BE2"  "Flemish Region"               .  .  1      .  .  .
"BE" "BE232" "Arr. Dendermonde"                                        "BE2"  "Flemish Region"               .  .  1      1  1  1
"BE" "BE233" "Arr. Eeklo"                                              "BE2"  "Flemish Region"               .  .  .      .  .  1
"BE" "BE234" "Arr. Gent"                                               "BE2"  "Flemish Region"               .  .  7      3  3  1
"BE" "BE235" "Arr. Oudenaarde"                                         "BE2"  "Flemish Region"               .  .  .      .  .  .
"BE" "BE236" "Arr. Sint-Niklaas"                                       "BE2"  "Flemish Region"               1  .  .      1  .  2
"BE" "BE241" "Arr. Halle-Vilvoorde"                                    "BE2"  "Flemish Region"               .  4  5      4  2  4
end

Thank you