2022-05-26 23:06:25 +08:00
|
|
|
---
|
|
|
|
aliases:
|
|
|
|
- /docs/grafana/latest/panels/query-a-data-source/use-expressions-to-manipulate-data/write-an-expression/
|
|
|
|
- /docs/sources/panels/query-a-data-source/use-expressions-to-manipulate-data/write-an-expression/
|
|
|
|
title: Write an expression
|
|
|
|
weight: 20
|
|
|
|
---
|
2022-01-19 05:06:27 +08:00
|
|
|
|
|
|
|
# Write an expression
|
|
|
|
|
|
|
|
If your data source supports them, then Grafana displays the **Expression** button and shows any existing expressions in the query editor list.
|
|
|
|
|
2022-05-27 20:42:51 +08:00
|
|
|
For more information about expressions, refer to [About expressions]({{< relref "about-expressions.md" >}}).
|
2022-01-19 05:06:27 +08:00
|
|
|
|
|
|
|
## Before you begin
|
|
|
|
|
|
|
|
- [Add a panel]({{< relref "../../working-with-panels/add-panel.md" >}}).
|
|
|
|
|
|
|
|
**To write an expression**:
|
|
|
|
|
|
|
|
1. Open the panel.
|
|
|
|
1. Below the query, click **Expression**.
|
|
|
|
1. In the **Operation** field, select the type of expression you want to write.
|
|
|
|
|
2022-05-27 20:42:51 +08:00
|
|
|
For more information about expression operations, refer to [About expressions]({{< relref "about-expressions.md" >}}).
|
2022-01-19 05:06:27 +08:00
|
|
|
|
|
|
|
1. Write the expression.
|
|
|
|
1. Click **Apply**.
|