Commit Graph

6 Commits (2ab200d78b6fc15c7bda287e62804dddb22bd5eb)

Author SHA1 Message Date
Jason Stirnaman ec70614a4e
docs(sql): add LAG examples for time-based value comparisons (#6577)
* chore(sql): add LAG examples for time-based value comparisons

Enhance window function documentation with practical examples for
calculating differences between current and previous values (e.g., 1h ago).

- Add 3 LAG examples to window functions reference with tested queries
- Create new 'Compare values' query guide covering common time-based
  comparison patterns (differences, percentage changes, exact intervals)
- Add guide frontmatter for all InfluxDB 3 products

All queries validated against InfluxDB 3 Core.

Refs: Kapa.ai conversation https://app.kapa.ai/720100f9-ce93-4305-88fd-5fcf71effad7/conversations/4536b79e-3930-4359-87f5-2ad9ccc1917d
Starting from: https://docs.influxdata.com/influxdb3/cloud-serverless/reference/sql/functions/window/

* chore(sql): add counter metrics examples to compare-values guide

Enhance time-based value comparisons with counter metrics patterns
using LAG and GREATEST to handle counter resets.

- Add counter metrics section with 3 examples (rate, cumulative, intervals)
- Include tested queries for non-negative differences and aggregation
- Document workarounds for Flux increase() and InfluxQL NON_NEGATIVE_DIFFERENCE()

All queries validated against InfluxDB 3 Core.

Refs: Kapa.ai conversation https://app.kapa.ai/720100f9-ce93-4305-88fd-5fcf71effad7/conversations/16b13679-0ced-4780-ab58-3d9cacb2d899
Starting from: https://docs.influxdata.com/influxdb3/enterprise/

* Update content/shared/influxdb3-query-guides/sql/compare-values.md

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>

---------

Co-authored-by: Scott Anderson <sanderson@users.noreply.github.com>
2025-12-01 15:14:44 -06:00
Scott Anderson 988aef7e07 fix(sql): hotfix typos in sql window functions doc 2025-09-11 08:58:47 -06:00
Scott Anderson 8f729f9500
chore(sql): Update SQL reference with additional functions (#6359)
* feat(sql): WIP added struct and map functions

* chore(sql): update sql reference with new functions

* chore(sql): migrate sql reference function updates to other projects

* chore(sql): readd deleted cache functions pages

* Update content/shared/sql-reference/functions/array.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix(sql): fixed broken anchor links

* fix(sql): fixed typos

* Apply suggestions from code review

Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jason Stirnaman <jstirnaman@influxdata.com>
2025-09-05 08:26:38 -06:00
Jason Stirnaman d7200f1363 chore(sql): how ranking functions handle duplicate values
- Add query example with output from @appletreeisyellow
- Clarify function descriptions
2025-02-25 10:06:09 -06:00
Jason Stirnaman 01236c6791 fix(sql): Apply suggestions from code review. 2025-02-24 13:35:41 -06:00
Scott Anderson 0e7d23dbac add sql window functions and new shortcodes 2025-02-21 14:11:32 -07:00