Queries
Quick check
- Does the surface have data?
ProductData | take 10. - Is the KQL valid?
- Does the time window contain data?
Common issues
Empty results - widen the window, check field names (case-sensitive), and add filters one at a time. Full walk-through: Query returns empty.
Syntax error
| Error | Cause | Fix |
|---|---|---|
| unexpected character | wrong quotes/operator | double quotes for strings |
| column not found | field typo | ProductData | take 1 | project * |
| invalid operator | wrong comparison | use == not = |
| cannot convert | type mismatch | check the data types |
Slow query - put the time filter first:
// slow: scans everything
ProductData | where Campaign == "spring"
// fast: time filter first
ProductData | where Timestamp > ago(1h) | where Campaign == "spring"
KQL help
| where Status =~ "active" // case-insensitive
| where Signups between (10 .. 100) // range
| where Timestamp > ago(7d) // relative time
| where isnotnull(Signups) // exclude nulls
Calling it over the API
- 404 - the query name is wrong or it isn't saved (not just drafted).
- 401 / 403 - token expired or outside your access rights.
- 500 - the query errored; test it in the surface first.
See KQL Basics and the REST API.