# \#query-editor

**URL:** https://community.grafana.com/tag/query-editor/259.md

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

---

## [Need help with GROT Academy Lab Section PromQL. Currently Stuck](https://community.grafana.com/t/need-help-with-grot-academy-lab-section-promql-currently-stuck/158452)

<div class="topic-metadata">

**Author:** [@jarpadul](https://community.grafana.com/u/jarpadul)\
**Replies:** 7\
**Last updated:** [May 8, 2026, 1:40pm UTC](https://community.grafana.com/t/need-help-with-grot-academy-lab-section-promql-currently-stuck/158452 "2026-05-08T13:40:37Z")

</div>

What Grafana version and what operating system are you using? Grafana Cloud, Windows 11 (Using Brave Browser) What are you trying to achieve? I was following the tutorial at GROT Academy: https://learn.grafana.c…

---

## [Changing a value of a field to get it written in InfluxDB2](https://community.grafana.com/t/changing-a-value-of-a-field-to-get-it-written-in-influxdb2/142296)

<div class="topic-metadata">

**Author:** [@janduehrig](https://community.grafana.com/u/janduehrig)\
**Replies:** 16\
**Last updated:** [November 13, 2025, 9:16pm UTC](https://community.grafana.com/t/changing-a-value-of-a-field-to-get-it-written-in-influxdb2/142296 "2025-11-13T21:16:27Z")

</div>

Hey together! First of all i am using the Grafana Version 11.3.0 and i installed it on my Raspberry Pi in Docker as a container. So i have extern variables which i send via MQTT and Node-Red to InfluxDB2 and displaying…

---

## [Query in Elasticsearch 7.5](https://community.grafana.com/t/query-in-elasticsearch-7-5/153102)

<div class="topic-metadata">

**Author:** [@marecellotarantino](https://community.grafana.com/u/marecellotarantino)\
**Replies:** 0\
**Last updated:** [June 21, 2025, 11:21am UTC](https://community.grafana.com/t/query-in-elasticsearch-7-5/153102 "2025-06-21T11:21:41Z")

</div>

Hello everyone, i created a data source with elasticsearch (i use grafana 7.5). i can’t create my query. suppose i have a “contacts” index that contains a list of contacts composed by name, surname, address, update\_date.…

---

## [Can I change graphs or use different queries for a graph based on custom variable?](https://community.grafana.com/t/can-i-change-graphs-or-use-different-queries-for-a-graph-based-on-custom-variable/147184)

<div class="topic-metadata">

**Author:** [@raywolters](https://community.grafana.com/u/raywolters)\
**Replies:** 11\
**Last updated:** [March 27, 2025, 10:44am UTC](https://community.grafana.com/t/can-i-change-graphs-or-use-different-queries-for-a-graph-based-on-custom-variable/147184 "2025-03-27T10:44:06Z")

</div>

Hi all, I am on Grafana v11.5.1 I want to have a graph, which based on the value of a dashboard variable, changes from plotting the absolute values or relative values. So if dashboard variable $displayMode is set to Ab…

---

## [How can I apply an expression to query results in Grafana?](https://community.grafana.com/t/how-can-i-apply-an-expression-to-query-results-in-grafana/146732)

<div class="topic-metadata">

**Author:** [@ingbrayancm](https://community.grafana.com/u/ingbrayancm)\
**Replies:** 0\
**Last updated:** [March 19, 2025, 9:26pm UTC](https://community.grafana.com/t/how-can-i-apply-an-expression-to-query-results-in-grafana/146732 "2025-03-19T21:26:12Z")

</div>

Hi , I’m working on a dashboard in Grafana where I have two queries (A and B). I want to perform a mathematical operation using an Expression (C) to combine the results of both queries. My setup: Query A → Retrieves t…

---

## [Query editor weird behaviour](https://community.grafana.com/t/query-editor-weird-behaviour/141793)

<div class="topic-metadata">

**Author:** [@maximbozek](https://community.grafana.com/u/maximbozek)\
**Replies:** 2\
**Last updated:** [January 30, 2025, 12:59pm UTC](https://community.grafana.com/t/query-editor-weird-behaviour/141793 "2025-01-30T12:59:41Z")

</div>

Hi, I updated from V11.2 to V11.5 and my query text area is acting weird. For some reason it is not displaying my cursor in the right spot. For example, right here I am at the end of the line, but the cursor is displaye…

---

## [How to use label in Oncall Alert Group use in query](https://community.grafana.com/t/how-to-use-label-in-oncall-alert-group-use-in-query/133781)

<div class="topic-metadata">

**Author:** [@parinyac](https://community.grafana.com/u/parinyac)\
**Replies:** 0\
**Last updated:** [October 8, 2024, 6:41am UTC](https://community.grafana.com/t/how-to-use-label-in-oncall-alert-group-use-in-query/133781 "2024-10-08T06:41:05Z")

</div>

product=“All Products” is not work

---

## [Virtual Cycle number creation](https://community.grafana.com/t/virtual-cycle-number-creation/133228)

<div class="topic-metadata">

**Author:** [@fjanni](https://community.grafana.com/u/fjanni)\
**Replies:** 2\
**Last updated:** [October 4, 2024, 5:31pm UTC](https://community.grafana.com/t/virtual-cycle-number-creation/133228 "2024-10-04T17:31:43Z")

</div>

Hi, I’d need your help how to create a virtual Cycle\_ID in an SQL table. It is necessary to calculate the total consumption of a certain cycle. I have a database, fields are ID, Timestamp, Countervalue. Countervalue sho…

---

## [Library panels cannot be edited](https://community.grafana.com/t/library-panels-cannot-be-edited/127662)

<div class="topic-metadata">

**Author:** [@eitah](https://community.grafana.com/u/eitah)\
**Replies:** 1\
**Last updated:** [September 26, 2024, 8:01pm UTC](https://community.grafana.com/t/library-panels-cannot-be-edited/127662 "2024-09-26T20:01:54Z")

</div>

What Grafana version and what operating system are you using? 11.1.3, linux What are you trying to achieve? Edit library panels after creation How are you trying to achieve it? “Edit” menu option which opens…

---

## [Expression Resample - remove query name from column](https://community.grafana.com/t/expression-resample-remove-query-name-from-column/132677)

<div class="topic-metadata">

**Author:** [@lucalerch](https://community.grafana.com/u/lucalerch)\
**Replies:** 1\
**Last updated:** [September 23, 2024, 7:48am UTC](https://community.grafana.com/t/expression-resample-remove-query-name-from-column/132677 "2024-09-23T07:48:32Z")

</div>

Hello Everyone I made a query to one of my datasource. After that i want to resample to sum all values up in a one day interval. I added an expression (with query name “B”). There i configured the Operation as “Resampl…

---

## [Query creation to separe Month and Year and SUM activity HOURS](https://community.grafana.com/t/query-creation-to-separe-month-and-year-and-sum-activity-hours/132036)

<div class="topic-metadata">

**Author:** [@pautorras](https://community.grafana.com/u/pautorras)\
**Replies:** 2\
**Last updated:** [September 13, 2024, 10:41am UTC](https://community.grafana.com/t/query-creation-to-separe-month-and-year-and-sum-activity-hours/132036 "2024-09-13T10:41:46Z")

</div>

Hi folks, I need to make a Grafana query. The MySQL table database have information about interventions of our workers to help our clients. There is intervention Date, Intervention hours, travel hours, extra hours and …

---

## [Panel with multiple Queries: QueryEditor onChange() method not updating query \[DataSource Plugin\]](https://community.grafana.com/t/panel-with-multiple-queries-queryeditor-onchange-method-not-updating-query-datasource-plugin/124710)

<div class="topic-metadata">

**Author:** [@myriamgantner](https://community.grafana.com/u/myriamgantner)\
**Replies:** 1\
**Last updated:** [July 4, 2024, 4:00pm UTC](https://community.grafana.com/t/panel-with-multiple-queries-queryeditor-onchange-method-not-updating-query-datasource-plugin/124710 "2024-07-04T16:00:27Z")

</div>

Hi there! So I have a curious problem. I am migrating an angular Datasource plugin to react, with this migration I also need to change the custom DataQuery Type. In order to allow a seamless migration from dashboard JS…

---

## [Query editor weird behavior with google-cloud-monitoring datasource](https://community.grafana.com/t/query-editor-weird-behavior-with-google-cloud-monitoring-datasource/123316)

<div class="topic-metadata">

**Author:** [@Ace](https://community.grafana.com/u/Ace)\
**Replies:** 0\
**Last updated:** [June 5, 2024, 3:20pm UTC](https://community.grafana.com/t/query-editor-weird-behavior-with-google-cloud-monitoring-datasource/123316 "2024-06-05T15:20:13Z")

</div>

Hi Community, I have deployed a self-hosted grafana. Recently I’m using google-cloud-monitoring as one of the datasource. I tried to use it in explorer and edit the mql in the textarea, but weird things happen. when I c…

---

## [Drop-down list of predefined queries?](https://community.grafana.com/t/drop-down-list-of-predefined-queries/122226)

<div class="topic-metadata">

**Author:** [@dmitrikalinin](https://community.grafana.com/u/dmitrikalinin)\
**Replies:** 18\
**Last updated:** [May 22, 2024, 3:17pm UTC](https://community.grafana.com/t/drop-down-list-of-predefined-queries/122226 "2024-05-22T15:17:26Z")

</div>

Hello, Team. Please let us know if it possible to create a drop-down list of predefined SQL/Lucene/KQL/etc. queries in Grafana panel. It might look similar to what exists in “Explore” the data source. But it has to be a …

---

## [How to sum some fields and display it in line chart?](https://community.grafana.com/t/how-to-sum-some-fields-and-display-it-in-line-chart/122198)

<div class="topic-metadata">

**Author:** [@alifyazhafira29](https://community.grafana.com/u/alifyazhafira29)\
**Replies:** 1\
**Last updated:** [May 21, 2024, 1:48pm UTC](https://community.grafana.com/t/how-to-sum-some-fields-and-display-it-in-line-chart/122198 "2024-05-21T13:48:28Z")

</div>

I want to add a line chart displaying three lines: total\_data (total\_data\_bytes), rx (rx\_data\_bytes), and tx (tx\_data\_bytes). I use this query below at first: from(bucket: "wifi") |\> range(start: v.timeRangeStart, sto…

---

## [Filter start of day](https://community.grafana.com/t/filter-start-of-day/117983)

<div class="topic-metadata">

**Author:** [@fahmiyusuf2nd](https://community.grafana.com/u/fahmiyusuf2nd)\
**Replies:** 1\
**Last updated:** [March 27, 2024, 6:14am UTC](https://community.grafana.com/t/filter-start-of-day/117983 "2024-03-27T06:14:59Z")

</div>

How to filter time every day at 00.00 at my postgreSQL in Grafana? Thank you

---

## [Addition of queries via Expression option not working](https://community.grafana.com/t/addition-of-queries-via-expression-option-not-working/112256)

<div class="topic-metadata">

**Author:** [@codi639](https://community.grafana.com/u/codi639)\
**Replies:** 13\
**Last updated:** [February 14, 2024, 1:42pm UTC](https://community.grafana.com/t/addition-of-queries-via-expression-option-not-working/112256 "2024-02-14T13:42:37Z")

</div>

Hey guys, Using InfluxDB 1.8.10. I’m trying to monitor the bandwith of my routers. Since they don’t provide the total Rx Tx I have to calculate them by myself via query. The goal is to calculate for each interface: t…

---

## [Query wizard in Grafana v10.2.2](https://community.grafana.com/t/query-wizard-in-grafana-v10-2-2/111498)

<div class="topic-metadata">

**Author:** [@regiscoulonpillot](https://community.grafana.com/u/regiscoulonpillot)\
**Replies:** 0\
**Last updated:** [January 8, 2024, 3:06pm UTC](https://community.grafana.com/t/query-wizard-in-grafana-v10-2-2/111498 "2024-01-08T15:06:02Z")

</div>

Hello all I would like to use Grafana for visualize data from InfluxDB. I’ve been able to create the connection between InfluxDb.v2 & Grafana When I try to create a dashboard, there’s no query wizard like thi…

---

## [How do I specify/change pre-filled query builder for TimescaleDB?](https://community.grafana.com/t/how-do-i-specify-change-pre-filled-query-builder-for-timescaledb/111009)

<div class="topic-metadata">

**Author:** [@jmassucco](https://community.grafana.com/u/jmassucco)\
**Replies:** 2\
**Last updated:** [January 5, 2024, 7:58pm UTC](https://community.grafana.com/t/how-do-i-specify-change-pre-filled-query-builder-for-timescaledb/111009 "2024-01-05T19:58:53Z")

</div>

TL;DR the default values in query builder when clicking “add query” are problematic and I want to be able to specify/change what values get pre-filled in. I have a TimescaleDB instance which used to be indexed by one ti…

---

## [Queries are not working](https://community.grafana.com/t/queries-are-not-working/108730)

<div class="topic-metadata">

**Author:** [@nithya4](https://community.grafana.com/u/nithya4)\
**Replies:** 8\
**Last updated:** [December 25, 2023, 9:45pm UTC](https://community.grafana.com/t/queries-are-not-working/108730 "2023-12-25T21:45:32Z")

</div>

Queries which were working earlier are not working now. Please refer attached snippets for reference. Same Query shows expected output in one environment and not in another.

---

## [How to trigger alert based on cloudwatch events using grafana query where based on event, other details also should trigger in alert message](https://community.grafana.com/t/how-to-trigger-alert-based-on-cloudwatch-events-using-grafana-query-where-based-on-event-other-details-also-should-trigger-in-alert-message/109815)

<div class="topic-metadata">

**Author:** [@gourav2](https://community.grafana.com/u/gourav2)\
**Replies:** 0\
**Last updated:** [December 12, 2023, 6:11am UTC](https://community.grafana.com/t/how-to-trigger-alert-based-on-cloudwatch-events-using-grafana-query-where-based-on-event-other-details-also-should-trigger-in-alert-message/109815 "2023-12-12T06:11:03Z")

</div>

\#all I’m stuck with alerting issue I’m trying to run the query as below fields eventName | filter eventName =~ /DeleteBucket|DeleteBucketLifecycle|DeleteBucketPolicy|DeleteBucketReplication|DeleteBucketTagging|PutBuck…

---

## [How do i "lock" a query to a particular time filter?](https://community.grafana.com/t/how-do-i-lock-a-query-to-a-particular-time-filter/107310)

<div class="topic-metadata">

**Author:** [@ryanmiranda](https://community.grafana.com/u/ryanmiranda)\
**Replies:** 4\
**Last updated:** [November 15, 2023, 11:24pm UTC](https://community.grafana.com/t/how-do-i-lock-a-query-to-a-particular-time-filter/107310 "2023-11-15T23:24:33Z")

</div>

Hi there I have a normal bar chart, with a SQL Server query like this: SELECT Timestamp AS "time", Category, SUM(Cost) AS Cost FROM Metrics.dbo.Costs a GROUP BY Timestamp, Category ORDER BY Timestamp ASC The d…

---

## [Unable to execute query due to variables not decoding](https://community.grafana.com/t/unable-to-execute-query-due-to-variables-not-decoding/104701)

<div class="topic-metadata">

**Author:** [@saiteja05](https://community.grafana.com/u/saiteja05)\
**Replies:** 7\
**Last updated:** [October 2, 2023, 5:48pm UTC](https://community.grafana.com/t/unable-to-execute-query-due-to-variables-not-decoding/104701 "2023-10-02T17:48:14Z")

</div>

i am using grafana 10.0.0v What are you trying to achieve? i am getting sql query from a mysql table which i am storing in a variable and when i use the variable it should trigger the query present in the variable,it…

---

## [On the 1st of each month, the bar in the diagram is too wide](https://community.grafana.com/t/on-the-1st-of-each-month-the-bar-in-the-diagram-is-too-wide/100221)

<div class="topic-metadata">

**Author:** [@lnied2](https://community.grafana.com/u/lnied2)\
**Replies:** 0\
**Last updated:** [August 1, 2023, 6:24am UTC](https://community.grafana.com/t/on-the-1st-of-each-month-the-bar-in-the-diagram-is-too-wide/100221 "2023-08-01T06:24:31Z")

</div>

During the whole month, the bars in my graph are correctly aligned right over the right date - except on the 1st of each month. On this date, the bar is too wide. Example: What Grafana version and what operating s…

---

## [How to display elasticsearch "terms" by percent](https://community.grafana.com/t/how-to-display-elasticsearch-terms-by-percent/89878)

<div class="topic-metadata">

**Author:** [@jeremycohensolal](https://community.grafana.com/u/jeremycohensolal)\
**Replies:** 0\
**Last updated:** [June 19, 2023, 2:29pm UTC](https://community.grafana.com/t/how-to-display-elasticsearch-terms-by-percent/89878 "2023-06-19T14:29:10Z")

</div>

Hello Grafana 9.4 + Elasticsearch 8.6 I have logs with these properties route → http route (like GET /users/:id http\_code \> like 404, 200 … I want to calcul error\_percent by route error is count(http\_code \< 300) /…

---

## [Adding operator to show results less then](https://community.grafana.com/t/adding-operator-to-show-results-less-then/87731)

<div class="topic-metadata">

**Author:** [@batchenr](https://community.grafana.com/u/batchenr)\
**Replies:** 0\
**Last updated:** [May 16, 2023, 1:59pm UTC](https://community.grafana.com/t/adding-operator-to-show-results-less-then/87731 "2023-05-16T13:59:27Z")

</div>

Hey, I have bar chart that every bar shows 3 status from query, the metric itself looks like that: data{created="2017-08-03 08:29:58.645000", instance=“x.x.x.x:9000", job=“data-exporter", project=“TEST", state="OPEN",…

---

## [Creating a Grafana query to aggregate metrics for multiple URLs using variables](https://community.grafana.com/t/creating-a-grafana-query-to-aggregate-metrics-for-multiple-urls-using-variables/86961)

<div class="topic-metadata">

**Author:** [@yarshar7474](https://community.grafana.com/u/yarshar7474)\
**Replies:** 0\
**Last updated:** [May 3, 2023, 7:44am UTC](https://community.grafana.com/t/creating-a-grafana-query-to-aggregate-metrics-for-multiple-urls-using-variables/86961 "2023-05-03T07:44:04Z")

</div>

Hello, I have a PromQL query that calculates the average request duration for a specific URI pattern: avg(http\_client\_requests\_seconds\_sum{client\_name="data-api.eu.bio-beat.cloud", uri=~"/yarinapi-get-measurement?.\*"} …

---

## [Query editor missing in Enterprise edition?](https://community.grafana.com/t/query-editor-missing-in-enterprise-edition/85976)

<div class="topic-metadata">

**Author:** [@barts2108](https://community.grafana.com/u/barts2108)\
**Replies:** 0\
**Last updated:** [April 18, 2023, 11:37am UTC](https://community.grafana.com/t/query-editor-missing-in-enterprise-edition/85976 "2023-04-18T11:37:01Z")

</div>

What Grafana version and what operating system are you using? Grafana v9.4.7 Enterprise on Windows 10 22H2 (without any licensing) Grafana v9.4.7 OSS on Windows 10 22H2 (without any licensing) What are you trying …
