Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo sync for protected branch #2459

Merged
merged 4 commits into from
Nov 28, 2024
Merged
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
21 changes: 15 additions & 6 deletions data-explorer/kusto/query/in-cs-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: The case-sensitive in string operator
description: Learn how to use the in operator to filter data with a case-sensitive string.
ms.reviewer: alexans
ms.topic: reference
ms.date: 08/11/2024
ms.date: 11/27/2024
---
# in operator

Expand Down Expand Up @@ -31,10 +31,7 @@ Filters a record set for data with a case-sensitive string.
|--|--|--|--|
| *T* | `string` | :heavy_check_mark: | The tabular input to filter.|
| *col* | `string` | :heavy_check_mark: | The column by which to filter.|
| *expression* | scalar or tabular | :heavy_check_mark: | An expression that specifies the values for which to search. the values for which to search. Each expression can be a [scalar](scalar-data-types/index.md) value or a [tabular expression](tabular-expression-statements.md) that produces a set of values. If a tabular expression has multiple columns, the first column is used. The search will consider up to 1,000,000 distinct values.|

> [!NOTE]
> An inline tabular expression must be enclosed with double parentheses. See [example](#tabular-expression).
| *expression* | scalar or tabular | :heavy_check_mark: | An expression that specifies the values for which to search. Each expression can be a [scalar](scalar-data-types/index.md) value or a [tabular expression](tabular-expression-statements.md) that produces a set of values. If a tabular expression has multiple columns, the first column is used. The search considers up to 1,000,000 distinct values.|

## Returns

Expand Down Expand Up @@ -129,6 +126,8 @@ StormEvents

### Top with other example

The following example identifies the top five states with lightning events and uses the `iff()` function and `in` operator to classify lightning events by the top five states, labeled by state name, and all others labeled as "Other."

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAA22PPQuDMBCG9/yKFxcVXJ3EpdCt0EF3sfaqKZpIPEst/vhGpVZqs+Tg7nk/amKcZFmxkqrMDkOWcM6EGI39jMxr+SIvYW2a44MUdwL2jej6psmN3aFeYZoPLFroXrG8eTORDq2Vi+GuLq6Py4DZx49EbQOkus3CxXni/+QZwbpFOIE7wxGt0XcqeNGMIPYCYgQ9mdQVn37SBlxmqeBtE/jBchTAOXNFxvHFtrCdvN8M30ZvE2wmM1ABAAA=" target="_blank">Run the query</a>
Expand Down Expand Up @@ -156,6 +155,8 @@ Lightning_By_State

### Use a static list returned by a function

The following example counts events from the `StormEvents` table based on a predefined list of interesting states. The interesting states are defined by the `InterestingStates()` function.

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
> <a href="https://dataexplorer.azure.com/clusters/help/databases/Samples?query=H4sIAAAAAAAAAwsuyS/KdS1LzSspVuCqUSjPSC1KVQguSSxJVcjMU9DwzCsBChSXZOalgwWLNTQ1QeqS80vzSgAtnqHrPAAAAA==" target="_blank">Run the query</a>
Expand All @@ -173,7 +174,7 @@ StormEvents
|---|
|4775|

The function definition.
The following query displays which states are considered interesting by the `InterestingStates()` function.

:::moniker range="azure-data-explorer"
> [!div class="nextstepaction"]
Expand All @@ -189,3 +190,11 @@ The function definition.
|Name|Parameters|Body|Folder|DocString|
|---|---|---|---|---|
|InterestingStates|()|{ dynamic(["WASHINGTON", "FLORIDA", "GEORGIA", "NEW YORK"]) }

## Related content

* [in~ operator](in-operator.md)
* [!in~ operator](not-in-operator.md)
* [!in operator](not-in-cs-operator.md)
* [contains_cs operator](contains-cs-operator.md)
* [has_cs operator](has-cs-operator.md)