diff --git a/data-explorer/kusto/query/sum-aggregation-function.md b/data-explorer/kusto/query/sum-aggregation-function.md index 3b88bb772d..329fd3c2c5 100644 --- a/data-explorer/kusto/query/sum-aggregation-function.md +++ b/data-explorer/kusto/query/sum-aggregation-function.md @@ -3,7 +3,7 @@ title: sum() (aggregation function) description: Learn how to use the sum() (aggregation function) function to calculate the sum of an expression across the group. ms.reviewer: alexans ms.topic: reference -ms.date: 08/11/2024 +ms.date: 11/25/2024 --- # sum() (aggregation function) @@ -33,33 +33,33 @@ Returns the sum value of *expr* across the group. ## Example -This example returns the total number of deaths by state. +This example returns the total value of crop and property damages by state, and sorted in descending value. :::moniker range="azure-data-explorer" > [!div class="nextstepaction"] -> Run the query +> Run the query ::: moniker-end ```kusto StormEvents -| summarize EventCount=count(), TotalDeathCases = sum(DeathsDirect) by State -| sort by TotalDeathCases +| summarize EventCount=count(), TotalDamages = sum(DamageCrops+DamageProperty) by State +| sort by TotalDamages ``` **Output** The results table shown includes only the first 10 rows. -| State | event_count | TotalDeathCases | -| -------------------- | ----------- | --------------- | -| TEXAS | 4701 | 71 | -| FLORIDA | 1042 | 57 | -| CALIFORNIA | 898 | 48 | -| ILLINOIS | 2022 | 29 | -| ALABAMA | 1315 | 29 | -| MISSOURI | 2016 | 20 | -| NEW YORK | 1750 | 19 | -| KANSAS | 3166 | 17 | -| GEORGIA | 1983 | 17 | -| TENNESSEE | 1125 | 17 | -| ... | ... | ... | +| State | Eventcount | TotalDamages | +| ---- | --- | +| CALIFORNIA | 898 | 2801954600 | +| GEORGIA | 1983 | 1190448750 | +| MISSOURI | 2016 | 1096887450 | +| OKLAHOMA | 1716 | 916557300 | +| MISSISSIPPI | 1218 | 802890160 | +| KANSAS | 3166 | 738830000 | +| TEXAS | 4701 | 572086700 | +| OHIO | 1233 | 417989500 | +| FLORIDA | 1042 | 379455260 | +| NORTH DAKOTA | 905 | 342460100 | +| ... | ... | ... |