top of page

Kusto Lightning Fact 1: summarize

  • Writer: azurecoder
    azurecoder
  • Jul 11, 2020
  • 2 min read

I recently ran an intro using Kusto in Azure Data Explorer with our team. Most of them are pretty adept at Kusto anyway but it gave me a chance to think through some key features which I wanted to explore.


I downloaded a sales dataset from the internet. A 500K row dataset you can find here (http://eforexcel.com/wp/downloads-18-sample-csv-files-data-sets-for-testing-sales/)


In order to one-click ingest the file into your Azure Data Explorer instance follow these steps.



You should also get started with Kusto Explorer here:



So for our first lesson, once you get the data loaded refer to the tablename you created on ingestion. For me that was sales.

sales 
| take 200;

Run this query and you should see 200 rows of data. It's worth noting that you can replace take with limit if you fancy. In order to get the row count you can run the following:

sales 
| count;

Assuming you used the 500K row dataset you should get the number 500000 returned. Now run this query and I'll explain it.

project Region, Total_Revenue, Order_Date
| summarize Earnings = round(sum(Total_Revenue) / 1000000000, 1) by Region, Year = getyear(Order_Date)
| order by Region, Year asc; 

Okay what happening here:

project Region, Total_Revenue, Order_Date

This is our equivalent of a SQL SELECT which give us the Region, Total_Revenue and Order_Date columns.

summarize Earnings = round(sum(Total_Revenue) / 1000000000, 1) by Region, Year = getyear(Order_Date)

We use the pipe operator to pipe the output to the summarize command and create a new column called Earnings from Total_Revenue. As Total_Revenue is represented in billions we round it to something easier to read and to 1 decimal place and summarize this by Region and the year in Order_Date using the KQL getyear function. This is the same as doing a SQL GROUP BY.


We then pipe the output again so that we can order by region and year ascending and voila we have a simple query which shows us how much each region made per year ordered by Region name.



4 Comments


UUdolfiJelenai
8 minutes ago

It would have been nice to have had a chance to see these watches in person in Geneva, particularly link because it's being offered in two different sizes. With watches of this general design type – link visible high-complication, modern openworked movement – I almost reflexively link expect diameters to come in at 42mm or higher, so seeing one put forward with more wearable dimensions, and in a lightweight material, titanium, piques my interest quite a bit.

Like

UUdolfiJelenai
11 hours ago

I'm not going to argue this is a $100,000 watch when, just a few years ago, one sold for $35,000. But prices aren't link crashing on important link early indie and neo-vintage watches like this Dubuis the way they have for modern, mass-produced watches. And if you're going to have an early Dubuis, the Hommage Condottieri link is still the one to have.

Like

KaleoxKendax
Apr 07

The Citizen Promaster Dive Automatic NY0155-58X is stealthy. There's a black link ion-plated coating on the 44mm case and bracelet and a full lume dial. Inside is the steadfast, hand-winding automatic link Citizen (or Miyota) link 8204. The most unusual thing about the watch is the left-hand crown placement, which has somehow eluded the "destro" label, probably because of the placement at eight o'clock.

Like

VYanislJennyl
Mar 26

Meanwhile, we'll see what the impact of today's announcement is on HourUniverse, the link new link watch and jewelry show link MCH created to replace Baselworld. It is scheduled to be held in Basel at the former Baselworld venue April 8-12, 2021, at the same time as Watches & Wonders Geneva.

Like

07590333990

©2019 by Richard Conway. Proudly created with Wix.com

bottom of page