From 4fbc8a0e28107d93cc8eab7b8bff8a4a41960db2 Mon Sep 17 00:00:00 2001 From: andykop <165172502+AndyKop@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:12:55 +0200 Subject: [PATCH 1/5] Change example --- .../kusto/query/sum-aggregation-function.md | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/data-explorer/kusto/query/sum-aggregation-function.md b/data-explorer/kusto/query/sum-aggregation-function.md index 3b88bb772d..7801625800 100644 --- a/data-explorer/kusto/query/sum-aggregation-function.md +++ b/data-explorer/kusto/query/sum-aggregation-function.md @@ -33,33 +33,34 @@ 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 number of thunderstorm events by state. :::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 +StormEvents +| where EventType == "Blizzard" +| summarize BlizzardCount=sum(1) by State +| sort by BlizzardCount ``` **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 | BlizzardCount | +| ---- | --- | +| ALASKA | 64 | +| IOWA | 62 | +| SOUTH DAKOTA | 51 | +| KANSAS | 45 | +| NEBRASKA | 45 | +| ILLINOIS | 44 | +| WISCONSIN | 33 | +| INDIANA | 27 | +| COLORADO | 26 | +| NORTH DAKOTA | 26 | +| ... | ... | From bff5fce4d275243609d00101977135f0062683f8 Mon Sep 17 00:00:00 2001 From: andykop <165172502+AndyKop@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:14:16 +0200 Subject: [PATCH 2/5] Fix parse --- data-explorer/kusto/query/parse-json-function.md | 1 - 1 file changed, 1 deletion(-) diff --git a/data-explorer/kusto/query/parse-json-function.md b/data-explorer/kusto/query/parse-json-function.md index 6bda97af36..8eea15f892 100644 --- a/data-explorer/kusto/query/parse-json-function.md +++ b/data-explorer/kusto/query/parse-json-function.md @@ -38,7 +38,6 @@ An object of type `dynamic` that is determined by the value of *json*: ## Example -In the following example, when `context_custom_metrics` is a `string` that looks like this: In the following example, when `context_custom_metrics` is a `string` that looks like this: ```json From de9a61e7b895f34e2ae06631c497220be8ff9593 Mon Sep 17 00:00:00 2001 From: andykop <165172502+AndyKop@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:22:30 +0200 Subject: [PATCH 3/5] Fix text --- data-explorer/kusto/query/sum-aggregation-function.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-explorer/kusto/query/sum-aggregation-function.md b/data-explorer/kusto/query/sum-aggregation-function.md index 7801625800..eef7579c1f 100644 --- a/data-explorer/kusto/query/sum-aggregation-function.md +++ b/data-explorer/kusto/query/sum-aggregation-function.md @@ -33,7 +33,7 @@ Returns the sum value of *expr* across the group. ## Example -This example returns the total number of thunderstorm events by state. +This example returns the total number of blizzards by state. :::moniker range="azure-data-explorer" > [!div class="nextstepaction"] From baef03c1c10451d80017f12b22f1920900a2b0f8 Mon Sep 17 00:00:00 2001 From: andykop <165172502+AndyKop@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:13:57 +0200 Subject: [PATCH 4/5] date --- data-explorer/kusto/query/sum-aggregation-function.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-explorer/kusto/query/sum-aggregation-function.md b/data-explorer/kusto/query/sum-aggregation-function.md index eef7579c1f..98d0b1cf98 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) From c8bc9f53c22d89af1cd6e268576da016a3b7ada5 Mon Sep 17 00:00:00 2001 From: andykop <165172502+AndyKop@users.noreply.github.com> Date: Wed, 4 Dec 2024 09:42:30 +0200 Subject: [PATCH 5/5] improve example --- .../kusto/query/sum-aggregation-function.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/data-explorer/kusto/query/sum-aggregation-function.md b/data-explorer/kusto/query/sum-aggregation-function.md index 98d0b1cf98..329fd3c2c5 100644 --- a/data-explorer/kusto/query/sum-aggregation-function.md +++ b/data-explorer/kusto/query/sum-aggregation-function.md @@ -33,34 +33,33 @@ Returns the sum value of *expr* across the group. ## Example -This example returns the total number of blizzards 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 -| where EventType == "Blizzard" -| summarize BlizzardCount=sum(1) by State -| sort by BlizzardCount +StormEvents +| summarize EventCount=count(), TotalDamages = sum(DamageCrops+DamageProperty) by State +| sort by TotalDamages ``` **Output** The results table shown includes only the first 10 rows. -| State | BlizzardCount | +| State | Eventcount | TotalDamages | | ---- | --- | -| ALASKA | 64 | -| IOWA | 62 | -| SOUTH DAKOTA | 51 | -| KANSAS | 45 | -| NEBRASKA | 45 | -| ILLINOIS | 44 | -| WISCONSIN | 33 | -| INDIANA | 27 | -| COLORADO | 26 | -| NORTH DAKOTA | 26 | -| ... | ... | +| 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 | +| ... | ... | ... |