# Fluxlang

**URL:** https://community.influxdata.com/c/fluxlang/10.md

[Latest](https://community.influxdata.com/latest.md) · [Categories](https://community.influxdata.com/categories.md) · [Tags](https://community.influxdata.com/tags.md)

---

## [Error while defining location parameter for aggregateWindow](https://community.influxdata.com/t/error-while-defining-location-parameter-for-aggregatewindow/24433)

<div class="topic-metadata">

**Author:** [@mutigozel](https://community.influxdata.com/u/mutigozel)\
**Replies:** 11\
**Last updated:** [June 29, 2026, 11:30pm UTC](https://community.influxdata.com/t/error-while-defining-location-parameter-for-aggregatewindow/24433 "2026-06-29T23:30:27Z")

</div>

Hi all, When I try to set location parameter in aggregateWindow parameters as below: |\> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false, location: "UTC") I get an error like: error @5:6-5:91: e…

---

## [Plot the difference between two stream/data](https://community.influxdata.com/t/plot-the-difference-between-two-stream-data/58268)

<div class="topic-metadata">

**Author:** [@HarimbolaSantatra](https://community.influxdata.com/u/HarimbolaSantatra)\
**Replies:** 1\
**Last updated:** [February 21, 2026, 8:39pm UTC](https://community.influxdata.com/t/plot-the-difference-between-two-stream-data/58268 "2026-02-21T20:39:17Z")

</div>

I have a random data like this: The query that I used: data1 = from(bucket: "testBucket") |\> range(start: -3h) |\> ... |\> yield(name: "data1 ") data2 = from(bucket: "testBucket") |\> range(start: -3h) |\> ..…

---

## [Can't run two Checks on measurements of different types?](https://community.influxdata.com/t/cant-run-two-checks-on-measurements-of-different-types/58179)

<div class="topic-metadata">

**Author:** [@ianh98](https://community.influxdata.com/u/ianh98)\
**Replies:** 0\
**Last updated:** [December 16, 2025, 5:56pm UTC](https://community.influxdata.com/t/cant-run-two-checks-on-measurements-of-different-types/58179 "2025-12-16T17:56:45Z")

</div>

So I’m trying to get Checks working (InfluxDB V2), using the API to generate checks from a given flux query. All the API stuff works, what I’m running into is that I seemingly can’t have different checks running monitor…

---

## [Difference() got a time shift and there are duplicate dates at the end](https://community.influxdata.com/t/difference-got-a-time-shift-and-there-are-duplicate-dates-at-the-end/30749)

<div class="topic-metadata">

**Author:** [@Ray\_Magini](https://community.influxdata.com/u/Ray_Magini)\
**Replies:** 5\
**Last updated:** [December 6, 2025, 2:34pm UTC](https://community.influxdata.com/t/difference-got-a-time-shift-and-there-are-duplicate-dates-at-the-end/30749 "2025-12-06T14:34:16Z")

</div>

I am on my first steps with flux right now and I cannot solve this issue, maybe someone could help me to understand it. I’ve got a shelly plug that reports a total energy value, it’s an increasing value. So I tried to f…

---

## [Records of my newborn naps - split at midnight](https://community.influxdata.com/t/records-of-my-newborn-naps-split-at-midnight/57845)

<div class="topic-metadata">

**Author:** [@borelg](https://community.influxdata.com/u/borelg)\
**Replies:** 4\
**Last updated:** [August 27, 2025, 9:44am UTC](https://community.influxdata.com/t/records-of-my-newborn-naps-split-at-midnight/57845 "2025-08-27T09:44:50Z")

</div>

Good morning, I have been trying for several days to correctly handle the naps of my newborn to create a dashboard that shows how long he sleeps per day. I am recording every nap in influxdb with 3 fields: start s…

---

## [Extrapolate function](https://community.influxdata.com/t/extrapolate-function/57814)

<div class="topic-metadata">

**Author:** [@donker](https://community.influxdata.com/u/donker)\
**Replies:** 4\
**Last updated:** [August 19, 2025, 9:52pm UTC](https://community.influxdata.com/t/extrapolate-function/57814 "2025-08-19T21:52:59Z")

</div>

Flux support interpolating between data points. I have timeseries data with data points at every whole hour by default, but this can change due to intermittency issues or because someone specified a different cadence for…

---

## [aggregateWindow and managing queries in local time](https://community.influxdata.com/t/aggregatewindow-and-managing-queries-in-local-time/31848)

<div class="topic-metadata">

**Author:** [@Timmwardion](https://community.influxdata.com/u/Timmwardion)\
**Replies:** 2\
**Last updated:** [July 24, 2025, 11:05am UTC](https://community.influxdata.com/t/aggregatewindow-and-managing-queries-in-local-time/31848 "2025-07-24T11:05:03Z")

</div>

Hi All. I’m trying to work with data in local time (Australia/Melbourne, or AEST we are currently in daylight savings). I have some sensors that are writing data to influx in batches but those batches contain a timesta…

---

## [How to aggregate by uneven daily hour intervals?](https://community.influxdata.com/t/how-to-aggregate-by-uneven-daily-hour-intervals/57586)

<div class="topic-metadata">

**Author:** [@dewi-ny-je](https://community.influxdata.com/u/dewi-ny-je)\
**Replies:** 0\
**Last updated:** [July 10, 2025, 7:33am UTC](https://community.influxdata.com/t/how-to-aggregate-by-uneven-daily-hour-intervals/57586 "2025-07-10T07:33:44Z")

</div>

I have a series with energy prices, and I can tell that I have two peaks and two dips in prices each day, and more specifically one pair in the hours 00:00-11:00 and one pair in the range 11:00-23:59. How can I calculat…

---

## [How to use syntax highlighting for Flux in Notepad++?](https://community.influxdata.com/t/how-to-use-syntax-highlighting-for-flux-in-notepad/57554)

<div class="topic-metadata">

**Author:** [@dewi-ny-je](https://community.influxdata.com/u/dewi-ny-je)\
**Replies:** 2\
**Last updated:** [July 7, 2025, 12:35pm UTC](https://community.influxdata.com/t/how-to-use-syntax-highlighting-for-flux-in-notepad/57554 "2025-07-07T12:35:25Z")

</div>

I prefer to edit the queries in Notepad++ because in Grafana there’s very little space. However, Notepad++ has no syntax highlighter for “Flux”. Has anyone made a syntax highlighter for Flux? if it’s for a different fr…

---

## [Is there anything wrong with this approach?](https://community.influxdata.com/t/is-there-anything-wrong-with-this-approach/57450)

<div class="topic-metadata">

**Author:** [@Dyslexicbloke](https://community.influxdata.com/u/Dyslexicbloke)\
**Replies:** 1\
**Last updated:** [June 26, 2025, 9:10pm UTC](https://community.influxdata.com/t/is-there-anything-wrong-with-this-approach/57450 "2025-06-26T21:10:07Z")

</div>

Hi folks, very new to all this and have a basic, I presume, question… I am using code in Node-Red to dynamically build Flux queries and have gone with a simplistic approach using an individual query and thus table outp…

---

## [Http.post the whole table](https://community.influxdata.com/t/http-post-the-whole-table/22001)

<div class="topic-metadata">

**Author:** [@Nam\_Giang](https://community.influxdata.com/u/Nam_Giang)\
**Replies:** 7\
**Last updated:** [June 12, 2025, 12:33am UTC](https://community.influxdata.com/t/http-post-the-whole-table/22001 "2025-06-12T00:33:56Z")

</div>

Hi there, I’m looking at this link: Convert results to JSON and send them to a URL | InfluxDB OSS 2.0 Documentation, where a code excerpt is as follow: import "http" import "json" from(bucket: "noaa") |\> filter(fn: …

---

## [JOIN from different measurements in one row](https://community.influxdata.com/t/join-from-different-measurements-in-one-row/57360)

<div class="topic-metadata">

**Author:** [@pistoletov1974](https://community.influxdata.com/u/pistoletov1974)\
**Replies:** 2\
**Last updated:** [June 11, 2025, 2:37pm UTC](https://community.influxdata.com/t/join-from-different-measurements-in-one-row/57360 "2025-06-11T14:37:38Z")

</div>

I need to combine two tables by name and time and get the result in one row in the form \_value\_sdc, \_value\_sdbi, \_value\_sdco,\_value\_sdc. These data arrive at the same time but have different measurement and a common ta…

---

## [Flux help required](https://community.influxdata.com/t/flux-help-required/57164)

<div class="topic-metadata">

**Author:** [@sparkitny](https://community.influxdata.com/u/sparkitny)\
**Replies:** 2\
**Last updated:** [May 4, 2025, 8:53pm UTC](https://community.influxdata.com/t/flux-help-required/57164 "2025-05-04T20:53:43Z")

</div>

Hi, currently I’m struggling with joining two tables together. Maybe someone has an idea, as I’m driving crazy understanding the possibilities of flux. Suppose the following two tables: left = from(bucket: "pon") |\>…

---

## [Sequential aggregate functions](https://community.influxdata.com/t/sequential-aggregate-functions/57096)

<div class="topic-metadata">

**Author:** [@pistoletov1974](https://community.influxdata.com/u/pistoletov1974)\
**Replies:** 2\
**Last updated:** [April 28, 2025, 4:38pm UTC](https://community.influxdata.com/t/sequential-aggregate-functions/57096 "2025-04-28T16:38:37Z")

</div>

Please,еell me how to calculate such data using flux. I need to take the sum of the maximums for 10 days from the data. I see it as two consecutive aggregate window functions, first with a search for the maximum with a w…

---

## [Adding new row to the table depending on if statement](https://community.influxdata.com/t/adding-new-row-to-the-table-depending-on-if-statement/30348)

<div class="topic-metadata">

**Author:** [@Anna\_Iluk](https://community.influxdata.com/u/Anna_Iluk)\
**Replies:** 4\
**Last updated:** [April 23, 2025, 8:31pm UTC](https://community.influxdata.com/t/adding-new-row-to-the-table-depending-on-if-statement/30348 "2025-04-23T20:31:45Z")

</div>

Hi, I am performing some operations on my data stream in Flux and I want to add new records in the middle of a table or optionally to a new table if a certain condition is met. Example data: \_time,status 2023-05-28T00…

---

## [Count (in seconds) how long a value is '1'](https://community.influxdata.com/t/count-in-seconds-how-long-a-value-is-1/28554)

<div class="topic-metadata">

**Author:** [@Thomas\_Decock](https://community.influxdata.com/u/Thomas_Decock)\
**Replies:** 12\
**Last updated:** [April 21, 2025, 10:54pm UTC](https://community.influxdata.com/t/count-in-seconds-how-long-a-value-is-1/28554 "2025-04-21T22:54:36Z")

</div>

dear all, I want to measuere how long we are using our smartphones during the day, so eveytime the smartphone is active a ‘1’ is sent to the influx database, and when the phone is not active anymore, a value ‘0’ is sen…

---

## [Tariffs Query Optimization](https://community.influxdata.com/t/tariffs-query-optimization/56884)

<div class="topic-metadata">

**Author:** [@marcush](https://community.influxdata.com/u/marcush)\
**Replies:** 0\
**Last updated:** [March 31, 2025, 8:48am UTC](https://community.influxdata.com/t/tariffs-query-optimization/56884 "2025-03-31T08:48:43Z")

</div>

I was wondering if anyone could help me optimize this query. I have a ‘tariffs’ table with a ‘rate’ field and tags including start hour, end hour, weekday, valid from and valid to. I need to join this with another table …

---

## [Fill usePrevious with threshold](https://community.influxdata.com/t/fill-useprevious-with-threshold/56791)

<div class="topic-metadata">

**Author:** [@JeroenVH](https://community.influxdata.com/u/JeroenVH)\
**Replies:** 10\
**Last updated:** [March 26, 2025, 8:31am UTC](https://community.influxdata.com/t/fill-useprevious-with-threshold/56791 "2025-03-26T08:31:43Z")

</div>

To create a graph for event based data it is usefull to create empty entries with the aggregateWindow funtion and backfill them with the fill function. However, by doing this you lose the ability to “not connect null va…

---

## [Calculate MAE, MAPE and/or MSE](https://community.influxdata.com/t/calculate-mae-mape-and-or-mse/56353)

<div class="topic-metadata">

**Author:** [@mflores](https://community.influxdata.com/u/mflores)\
**Replies:** 3\
**Last updated:** [February 27, 2025, 8:06am UTC](https://community.influxdata.com/t/calculate-mae-mape-and-or-mse/56353 "2025-02-27T08:06:36Z")

</div>

Hello, I would like to create a periodical task that calculates mae, mape and mse directly on Influx, is it possible?

---

## [Data hole detection](https://community.influxdata.com/t/data-hole-detection/56453)

<div class="topic-metadata">

**Author:** [@donker](https://community.influxdata.com/u/donker)\
**Replies:** 2\
**Last updated:** [February 26, 2025, 7:57pm UTC](https://community.influxdata.com/t/data-hole-detection/56453 "2025-02-26T19:57:23Z")

</div>

I am stumped trying to figure out how to do this. I have measurement data from 1000s of sensors (each sensor ID is a tag). These measurements are done every hour. What I need to do is to detect if there are any “holes” i…

---

## [Multiply two measured values with the map-funktion](https://community.influxdata.com/t/multiply-two-measured-values-with-the-map-funktion/56417)

<div class="topic-metadata">

**Author:** [@dave](https://community.influxdata.com/u/dave)\
**Replies:** 1\
**Last updated:** [February 18, 2025, 10:58am UTC](https://community.influxdata.com/t/multiply-two-measured-values-with-the-map-funktion/56417 "2025-02-18T10:58:45Z")

</div>

Hello, The picture shows a query that should multiply two measured values. Both measured values, “F30106\_X1/MEAS\_MON.U” and “F30204/MonAnL.UserAnal#Value,” have stored float values, as you can see in the picture. My …

---

## [How to Group and Count Unique IP, Latitude, and Longitude Combinations in InfluxDB Flux?](https://community.influxdata.com/t/how-to-group-and-count-unique-ip-latitude-and-longitude-combinations-in-influxdb-flux/56412)

<div class="topic-metadata">

**Author:** [@noname\_thomas](https://community.influxdata.com/u/noname_thomas)\
**Replies:** 0\
**Last updated:** [February 17, 2025, 11:07am UTC](https://community.influxdata.com/t/how-to-group-and-count-unique-ip-latitude-and-longitude-combinations-in-influxdb-flux/56412 "2025-02-17T11:07:37Z")

</div>

Hello, I have a small side project to parse log ip from nginx reverse proxy. I get the ip,source\_lat,source\_lon What I would like is first to group the combinations (ip,source\_lat,source\_lon ) together and then count t…

---

## [Merge fields into one row, even with different timestamps?](https://community.influxdata.com/t/merge-fields-into-one-row-even-with-different-timestamps/55980)

<div class="topic-metadata">

**Author:** [@ticchioned](https://community.influxdata.com/u/ticchioned)\
**Replies:** 0\
**Last updated:** [January 22, 2025, 3:32pm UTC](https://community.influxdata.com/t/merge-fields-into-one-row-even-with-different-timestamps/55980 "2025-01-22T15:32:44Z")

</div>

I have what is likely a rather trivial question, but for some reason it has me stuck. I am trying to add some filters to my query. I would like to essentially be able to filter on all of my fields values, sort of like …

---

## [Trying to show now and last year on the same graph](https://community.influxdata.com/t/trying-to-show-now-and-last-year-on-the-same-graph/38700)

<div class="topic-metadata">

**Author:** [@carmelo42](https://community.influxdata.com/u/carmelo42)\
**Replies:** 6\
**Last updated:** [January 21, 2025, 10:41am UTC](https://community.influxdata.com/t/trying-to-show-now-and-last-year-on-the-same-graph/38700 "2025-01-21T10:41:40Z")

</div>

Hi ! I have all my home automation data in an influx bucket. In grafana, I can show the last 24h temperatures from the “ext” sensor : from(bucket: "telegraf/autogen") |\> range(start: v.timeRangeStart, stop: …

---

## [Comparing data from different years, months, ... time ranges](https://community.influxdata.com/t/comparing-data-from-different-years-months-time-ranges/22199)

<div class="topic-metadata">

**Author:** [@Jens](https://community.influxdata.com/u/Jens)\
**Replies:** 5\
**Last updated:** [January 21, 2025, 10:40am UTC](https://community.influxdata.com/t/comparing-data-from-different-years-months-time-ranges/22199 "2025-01-21T10:40:38Z")

</div>

Hello, I would like to compare time series values from multiple years contained in the same measurement. Specifically, compare my last year’s gas and electricity usage to this year’s. I think this is achievable by remo…

---

## [Missing added field when using to() function - though query includes all fields](https://community.influxdata.com/t/missing-added-field-when-using-to-function-though-query-includes-all-fields/54611)

<div class="topic-metadata">

**Author:** [@Gerhard\_Lang](https://community.influxdata.com/u/Gerhard_Lang)\
**Replies:** 3\
**Last updated:** [January 18, 2025, 7:42am UTC](https://community.influxdata.com/t/missing-added-field-when-using-to-function-though-query-includes-all-fields/54611 "2025-01-18T07:42:36Z")

</div>

Hello. Maybe you can help me with this. I am collecting my PV data. In the query (manually) all is correct, all fields exist, including the “panel” field: import “timezone” import “date” option location = timezone.lo…

---

## [How do I aggregate data from multiple tags and show them as one?](https://community.influxdata.com/t/how-do-i-aggregate-data-from-multiple-tags-and-show-them-as-one/50132)

<div class="topic-metadata">

**Author:** [@ishan](https://community.influxdata.com/u/ishan)\
**Replies:** 0\
**Last updated:** [January 5, 2025, 5:00pm UTC](https://community.influxdata.com/t/how-do-i-aggregate-data-from-multiple-tags-and-show-them-as-one/50132 "2025-01-05T17:00:23Z")

</div>

Hi I have some queries like this, from(bucket: "rb5009") |\> range(start: v.timeRangeStart, stop: v.timeRangeStop) |\> filter(fn: (r) =\> r\["\_measurement"\] == "interface") |\> filter(fn: (r) =\> r\["ifDescr"\] == "wan1")…

---

## [Best way to get timestamps from integer](https://community.influxdata.com/t/best-way-to-get-timestamps-from-integer/48916)

<div class="topic-metadata">

**Author:** [@user642](https://community.influxdata.com/u/user642)\
**Replies:** 7\
**Last updated:** [January 3, 2025, 9:22pm UTC](https://community.influxdata.com/t/best-way-to-get-timestamps-from-integer/48916 "2025-01-03T21:22:23Z")

</div>

Hello, I have a Col with Integer 1 to 12 and need to get Timestamp. For example 1 =\> 2024-01-01 2= \> 2024-02-01 … whats the best way to do this? thanks

---

## [Sum two column with integer as column tag](https://community.influxdata.com/t/sum-two-column-with-integer-as-column-tag/39839)

<div class="topic-metadata">

**Author:** [@vodet](https://community.influxdata.com/u/vodet)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 5:53pm UTC](https://community.influxdata.com/t/sum-two-column-with-integer-as-column-tag/39839 "2024-12-16T17:53:25Z")

</div>

Hi, I cannot sum two column ( 1 and 2) now I add the map function and sum the column 1 and 2 |\> map(fn: (r) =\> ({r with \_value: r.1 + r.2 }) ) but the result is an error Could someone help me to fix the error? …

---

## [Exists flux operator creating runtime error](https://community.influxdata.com/t/exists-flux-operator-creating-runtime-error/39067)

<div class="topic-metadata">

**Author:** [@aipers](https://community.influxdata.com/u/aipers)\
**Replies:** 0\
**Last updated:** [November 1, 2024, 8:45pm UTC](https://community.influxdata.com/t/exists-flux-operator-creating-runtime-error/39067 "2024-11-01T20:45:46Z")

</div>

Hi, I am trying to filter my bucket based \_field and \_value as shown below. However, I get the following runtime error. from(bucket: "main\_bucket") |\> range(start: v.timeRangeStart, stop: v.timeRangeStop) |\> fil…

[Next page](https://community.influxdata.com/c/fluxlang/10.md?page=1)
