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.



6 Comments


NXerxesrWinemar
Jul 05

A testament to perseverance, Harris grabbed this watch on his honeymoon in Capri link (not a bad honeymoon gift) after knocking on the door repeatedly. Harris tells it better than I ever could so watch link the video for the full story, but link let's just say persistence pays off.

Like

NXerxesrWinemar
Jul 03

A year later, Stern would use these machines and patterns to develop a process we now know as tapisserie and, working with Genta, the link ref. 5402 Royal Oak dial was born. In 1976, Genta returned, wanting a similar style dial for link his latest project with Patek Philippe. Stern offered 10 tapisserie options, all based on the La Nationale-inherited patterns. Ultimately, Henri Stern himself link chose the eventual finish for the ref. 3700 Nautilus.

Like

UUdolfiJelenai
Apr 19

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
Apr 18

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

07590333990

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

bottom of page