Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions data-explorer/kusto/query/activity-counts-metrics-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ The following table describes the output table schema.

## Examples

### Daily activity counts

The next query calculates daily activity counts for the provided input table.

:::moniker range="azure-data-explorer"
Expand Down
8 changes: 1 addition & 7 deletions data-explorer/kusto/query/activity-engagement-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ Output table schema is:

## Examples

### DAU/WAU calculation

The following example calculates DAU/WAU (Daily Active Users / Weekly Active Users ratio) over a randomly generated data.

:::moniker range="azure-data-explorer"
Expand All @@ -70,8 +68,6 @@ range _day from _start to _end step 1d

:::image type="content" source="media/activity-engagement-plugin/activity-engagement-dau-wau.png" border="false" alt-text="Graph displaying the ratio of daily active users to weekly active users as specified in the query.":::

### DAU/MAU calculation

The following example calculates DAU/WAU (Daily Active Users / Weekly Active Users ratio) over a randomly generated data.

:::moniker range="azure-data-explorer"
Expand All @@ -95,9 +91,7 @@ range _day from _start to _end step 1d
```

:::image type="content" source="media/activity-engagement-plugin/activity-engagement-dau-mau.png" border="false" alt-text="Graph displaying the ratio of daily active users to monthly active users as specified in the query.":::

### DAU/MAU calculation with additional dimensions


The following example calculates DAU/WAU (Daily Active Users / Weekly Active Users ratio) over a randomly generated data with additional dimension (`mod3`).

:::moniker range="azure-data-explorer"
Expand Down
8 changes: 3 additions & 5 deletions data-explorer/kusto/query/activity-metrics-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,14 @@ where the `# of customer lost in the period` is defined as:
The higher score means the larger number of users are NOT returning to the service.

***Churn vs. Retention Rate***

The churn vs. retention Rate is derived from the definition of `Churn Rate` and `Retention Rate`. The following calculation is always true:

> [`Retention Rate`] = 100.0% - [`Churn Rate`]

## Examples

### Weekly retention rate and churn rate

The next query calculates retention and churn rate for week-over-week window.
The following example calculates retention and churn rate for week-over-week window.

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand Down Expand Up @@ -135,9 +134,8 @@ range _day from _start to _end step 1d

:::image type="content" source="media/activity-metrics-plugin/activity-metrics-churn-and-retention.png" border="false" alt-text="Table showing the calculated retention and churn rates per seven days as specified in the query.":::

### Distinct values and distinct 'new' values

The next query calculates distinct values and 'new' values (IDs that didn't appear in previous time window) for week-over-week window.
The following example calculates distinct values and 'new' values (IDs that didn't appear in previous time window) for week-over-week window.

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ evaluate ai_chat_completion_prompt(prompt, connectionString)
```
::: moniker-end

The following example sends a separate prompt for each row to the Azure OpenAI chat completion model.

::: moniker range="azure-data-explorer"

### [Managed Identity](#tab/managed-identity)
The following example sends a separate prompt for each row to the Azure OpenAI chat completion model.

<!-- csl -->
~~~kusto
Expand Down
5 changes: 0 additions & 5 deletions data-explorer/kusto/query/all-graph-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ For zero length paths, the condition evaluates to `true`.

## Examples

The examples in this section show how to use the syntax to help you get started.

### Find all round-trip paths between two train stations using different lines for each direction

The following example shows how to use the `graph-match` operator with the `all()` function to find all round-trip paths between two stations in a transportation network. It uses a different line for each direction. The query constructs a graph from the `connections` data, finding all paths up to five connections long that use the `"red"` line for the outward route, and the `"blue"` line for the return route. The `all()` function ensures that all edges in the variable length edge are part of the same line, either `"red"` or `"blue"`.

:::moniker range="azure-data-explorer"
Expand Down Expand Up @@ -88,7 +84,6 @@ connections
|Central|South->South-West|West|Central->East|Central|
|West|South-West->South|Central|East->Central|West|

### Find the shortest path between two stations with Wi-Fi available

The following example shows how to use the `graph-shortest-paths` operator with the `all()` and `inner_nodes` functions to find a path between two stations in a transportation network. The query constructs a graph from the `connections` data and finds the shortest path from the `"South-West"` station to the `"North"` station, passing through stations where Wi-Fi is available.

Expand Down
2 changes: 0 additions & 2 deletions data-explorer/kusto/query/anomaly-diagnosis.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ demo_clustering1
| 2016-08-23 15:00:58.2222707 | scus | su5 | 9dbd1b161d5b4779a73cf19a7836ebd6 | 10007007 | 8215dcf6-2de0-42bd-9c90-181c70486c9c |
| 2016-08-23 15:00:59.9382620 | scus | su3 | 90d3d2fc7ecc430c9621ece335651a01 | 10007006 | 451e3c4c-0808-4566-a64d-84d85cf30978 |

### Use autocluster() for single record set clustering

Even though there are less than a thousand exceptions, it's still hard to find common segments, since there are multiple values in each column. You can use the [`autocluster()`](autocluster-plugin.md) plugin to instantly extract a short list of common segments and find the interesting clusters within the spike's two minutes, as seen in the following query:

Expand Down Expand Up @@ -155,7 +154,6 @@ You can see from the results above that the most dominant segment contains 65.74

Autocluster uses a proprietary algorithm for mining multiple dimensions and extracting interesting segments. "Interesting" means that each segment has significant coverage of both the records set and the features set. The segments are also diverged, meaning that each one is different from the others. One or more of these segments might be relevant for the RCA process. To minimize segment review and assessment, autocluster extracts only a small segment list.

### Use basket() for single record set clustering

You can also use the [`basket()`](basket-plugin.md) plugin as seen in the following query:

Expand Down
5 changes: 0 additions & 5 deletions data-explorer/kusto/query/any-graph-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ For zero length paths, the condition evaluates to `false`.

## Examples

The examples in this section show how to use the syntax to help you get started.

### Find any round-trip paths between two train stations using different lines in each direction

The following example uses the `Locations` and `Routes` data tables to construct a graph that finds paths from a source location to a destination location through a `route`. It uses `any()` function to find paths that uses `"Train"` transportation method at least once. It returns the source location name, destination location name and transportation methods along the route.

:::moniker range="azure-data-explorer"
Expand Down Expand Up @@ -85,7 +81,6 @@ Routes
| New York | Seattle | [<br> "Train", <br> "Train"<br>] |
| Los Angeles | Chicago | [<br> "Truck", <br> "Train"<br>]|

### Find the shortest path between two stations with Wi-Fi available

The following example shows how to use the `graph-shortest-paths` operator with the `any()` and `inner_nodes` functions to find a path between two stations in a transportation network. The query constructs a graph from the `connections` data and finds the shortest path from the `"South-West"` station to the `"North"` station, passing through at least one station where Wi-Fi is available.

Expand Down
6 changes: 1 addition & 5 deletions data-explorer/kusto/query/arg-max-aggregation-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Returns a row in the table that maximizes the specified expression *ExprToMaximi

## Examples

### Find maximum latitude

The following example finds the maximum latitude of a storm event in each state.

:::moniker range="azure-data-explorer"
Expand Down Expand Up @@ -69,7 +67,6 @@ The results table displays only the first 10 rows.
| TEXAS | 36.4607 | DARROUZETT |
| ... | ... | ... |

### Find last state fatal event

The following example finds the last time an event with a direct death happened in each state, showing all the columns.

Expand Down Expand Up @@ -104,7 +101,6 @@ The results table displays only the first 10 rows and first three columns.
| LAKE MICHIGAN | 2007-06-07T13:00:00Z | 2007-06-07T13:00:00Z | ... |
| ... | ... | ... | ... |

### Handle nulls

The following example demonstrates null handling.

Expand Down Expand Up @@ -141,7 +137,7 @@ The arg_max() function differs from the [max() function](max-aggregation-functio

#### arg_max()

Find the last time an event with a direct death happened, showing all the columns in the table.
The following example finds the last time an event with a direct death happened, showing all the columns in the table.

The query first filters the events to only include events where there was at least one direct death. Then the query returns the entire row with the most recent (maximum) StartTime.

Expand Down
2 changes: 1 addition & 1 deletion data-explorer/kusto/query/around-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Creates a `bool` value indicating if the first argument is within a range around
Returns `true` if the value is within the range, `false` if the value is outside the range.
Returns `null` if any of the arguments is `null`.

## Example: Filtering values around a specific timestamp
## Examples

The following example filters rows around specific timestamp.

Expand Down
2 changes: 1 addition & 1 deletion data-explorer/kusto/query/array-concat-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Concatenates many dynamic arrays to a single array.

Returns a dynamic array of all input arrays.

## Example
## Examples

The following example shows concatenated arrays.

Expand Down
2 changes: 1 addition & 1 deletion data-explorer/kusto/query/array-index-of-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Returns a zero-based index position of lookup.
Returns -1 if the value isn't found in the array.
Returns *null* for irrelevant inputs (*occurrence* < 0 or *length* < -1).

## Example
## Examples

The following example shows the position number of specific words within the array.

Expand Down
4 changes: 2 additions & 2 deletions data-explorer/kusto/query/array-reverse-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Reverses the order of the elements in a dynamic array.

Returns an array that contains the same elements as the input array in reverse order.

## Example
## Examples

This example shows an array of words reversed.
The following example shows an array of words reversed.

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand Down
4 changes: 2 additions & 2 deletions data-explorer/kusto/query/array-rotate-left-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Dynamic array containing the same elements as the original array with each eleme

## Examples

Rotating to the left by two positions:
The following example shows rotating to the left by two positions:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand All @@ -48,7 +48,7 @@ print arr=dynamic([1,2,3,4,5])
|---|---|
|[1,2,3,4,5]|[3,4,5,1,2]|

Rotating to the right by two positions by using negative rotate_count value:
The following example shows rotating to the right by two positions by using negative rotate_count value:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand Down
4 changes: 2 additions & 2 deletions data-explorer/kusto/query/array-rotate-right-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Dynamic array containing the same elements as the original array with each eleme

## Examples

Rotating to the right by two positions:
The following example shows rotating to the right by two positions:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand All @@ -48,7 +48,7 @@ print arr=dynamic([1,2,3,4,5])
|---|---|
|[1,2,3,4,5]|[4,5,1,2,3]|

Rotating to the left by two positions by using negative rotate_count value:
The following example shows rotating to the left by two positions by using negative rotate_count value:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand Down
6 changes: 3 additions & 3 deletions data-explorer/kusto/query/array-shift-left-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Returns a dynamic array containing the same number of elements as in the origina

## Examples

Shifting to the left by two positions:
The following example shows shifting to the left by two positions:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand All @@ -49,7 +49,7 @@ print arr=dynamic([1,2,3,4,5])
|---|---|
|[1,2,3,4,5]|[3,4,5,null,null]|

Shifting to the left by two positions and adding default value:
The following example shows shifting to the left by two positions and adding default value:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand All @@ -67,7 +67,7 @@ print arr=dynamic([1,2,3,4,5])
|---|---|
|[1,2,3,4,5]|[3,4,5,-1,-1]|

Shifting to the right by two positions by using negative *shift_count* value:
The following example shows shifting to the right by two positions by using negative *shift_count* value:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand Down
6 changes: 3 additions & 3 deletions data-explorer/kusto/query/array-shift-right-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Returns a dynamic array containing the same amount of the elements as in the ori

## Examples

Shifting to the right by two positions:
The following example shows shifting to the right by two positions:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand All @@ -49,7 +49,7 @@ print arr=dynamic([1,2,3,4,5])
|---|---|
|[1,2,3,4,5]|[null,null,1,2,3]|

Shifting to the right by two positions and adding a default value:
The following example shows shifting to the right by two positions and adding a default value:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand All @@ -67,7 +67,7 @@ print arr=dynamic([1,2,3,4,5])
|---|---|
|[1,2,3,4,5]|[-1,-1,1,2,3]|

Shifting to the left by two positions by using a negative shift_count value:
The following example shows shifting to the left by two positions by using a negative shift_count value:

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand Down
6 changes: 0 additions & 6 deletions data-explorer/kusto/query/array-sort-asc-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ An array which contains elements of different types, is sorted in the following

## Examples

The examples in this section show how to use the syntax to help you get started.

### Sort two arrays

The following example sorts the initial array, `array1`, in ascending order. It then sorts `array2` to match the new order of `array1`.

Expand All @@ -67,7 +64,6 @@ print array_sort_asc(array1,array2)
> [!NOTE]
> The output column names are generated automatically, based on the arguments to the function. To assign different names to the output columns, use the following syntax: `... | extend (out1, out2) = array_sort_asc(array1,array2)`.

### Sort substrings

The following example sorts a list of names in ascending order. It saves a list of names to a variable, `Names`, which is then splits into an array and sorted in ascending order. The query returns the names in ascending order.

Expand All @@ -88,7 +84,6 @@ print result = SortedNames
|---|
|Jane,John,Kao,Paul|

### Combine summarize and array_sort_asc

The following example uses the `summarize` operator and the `array_sort_asc` function to organize and sort commands by user in chronological order.

Expand Down Expand Up @@ -123,7 +118,6 @@ datatable(command:string, command_time:datetime, user_id:string)
> [!NOTE]
> If your data might contain `null` values, use [make_list_with_nulls](make-list-with-nulls-aggregation-function.md) instead of [make_list](make-list-aggregation-function.md).

### Control location of `null` values

By default, `null` values are put last in the sorted array. However, you can control it explicitly by adding a `bool` value as the last argument to `array_sort_asc()`.

Expand Down
7 changes: 0 additions & 7 deletions data-explorer/kusto/query/array-sort-desc-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ An array which contains elements of different types, is sorted in the following

## Examples

The examples in this section show how to use the syntax to help you get started.

### Sort two arrays

The following example sorts the initial array, `array1`, in descending order. It then sorts `array2` to match the new order of `array1`.

:::moniker range="azure-data-explorer"
Expand All @@ -69,7 +65,6 @@ print array_sort_desc(array1,array2)
> [!NOTE]
> The output column names are generated automatically, based on the arguments to the function. To assign different names to the output columns, use the following syntax: `... | extend (out1, out2) = array_sort_desc(array1,array2)`.

## Sort substrings

The following example sorts a list of names in descending order. It saves a list of names to a variable, `Names`, which is then splits into an array and sorted in descending order. The query returns the names in descending order.

Expand All @@ -90,7 +85,6 @@ print result = SortedNames
|---|
|Paul,Kayo,John,Jane|

### Combine summarize and array_sort_desc

The following example uses the `summarize` operator and the `array_sort_asc` function to organize and sort commands by user in descending chronological order.

Expand Down Expand Up @@ -125,7 +119,6 @@ datatable(command:string, command_time:datetime, user_id:string)
> [!NOTE]
> If your data can contain `null` values, use [make_list_with_nulls](make-list-with-nulls-aggregation-function.md) instead of [make_list](make-list-aggregation-function.md).

### Control location of `null` values

By default, `null` values are put last in the sorted array. However, you can control it explicitly by adding a `bool` value as the last argument to `array_sort_asc()`.

Expand Down
2 changes: 0 additions & 2 deletions data-explorer/kusto/query/array-split-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Returns a dynamic array containing N+1 arrays with the values in the range `[0..

## Examples

This following example shows how to split and array.

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
> <a href="https://dataexplorer.azure.com/?query=H4sIAAAAAAAAAysoyswrUUgsKrJNqcxLzM1M1og21DHSMdYx0TGN1VTgqlFIrShJzUsBKYkvLsjJLLEFshIrIWwNIFtHwUgTAB7YikBGAAAA" target="_blank">Run the query</a>
Expand Down
2 changes: 1 addition & 1 deletion data-explorer/kusto/query/array-sum-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Returns a double type value with the sum of the elements of the array.
> [!NOTE]
> If the array contains elements of non-numeric types, the result is `null`.

## Example
## Examples

This following example shows the sum of an array.

Expand Down
Loading